From 447c031ba4b6b306bb3f77690af06f5d2ad0691b Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Mon, 29 Oct 2012 05:23:48 +0000 Subject: scsi: Add function and env var to report number of scsi drives Add a new function to find out the number of available SCSI disks. Also set the 'scsidevs' environment variable after each scan. Signed-off-by: Stefan Reinauer Signed-off-by: Simon Glass --- common/cmd_scsi.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'common') diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c index 31ea78845c..9bd8ec9ecb 100644 --- a/common/cmd_scsi.c +++ b/common/cmd_scsi.c @@ -184,6 +184,14 @@ removable: scsi_curr_dev=0; else scsi_curr_dev = -1; + + printf("Found %d device(s).\n", scsi_max_devs); + setenv_ulong("scsidevs", scsi_max_devs); +} + +int scsi_get_disk_count(void) +{ + return scsi_max_devs; } #ifdef CONFIG_PCI -- cgit v1.2.1