All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robherring2@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 04/20] scsi: Add function to report number of scsi drives
Date: Fri, 19 Oct 2012 07:16:24 -0500	[thread overview]
Message-ID: <50814498.8020105@gmail.com> (raw)
In-Reply-To: <1350618317-6878-5-git-send-email-sjg@chromium.org>

On 10/18/2012 10:45 PM, Simon Glass wrote:
> From: Stefan Reinauer <reinauer@chromium.org>
> 
> Add a new function to find out the number of available SCSI disks.

Wouldn't setting an environment variable be more useful? Then we can
loop over devices in boot scripts.

Rob

> 
> Signed-off-by: Stefan Reinauer <reinauer@chromium.org>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>  common/cmd_scsi.c |    7 +++++++
>  include/scsi.h    |    2 ++
>  2 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
> index 30d8d12..f64d6f4 100644
> --- a/common/cmd_scsi.c
> +++ b/common/cmd_scsi.c
> @@ -182,6 +182,13 @@ removable:
>  		scsi_curr_dev=0;
>  	else
>  		scsi_curr_dev = -1;
> +
> +	printf("Found %d device(s).\n", scsi_max_devs);
> +}
> +
> +int scsi_get_disk_count(void)
> +{
> +	return scsi_max_devs;
>  }
>  
>  #ifdef CONFIG_PCI
> diff --git a/include/scsi.h b/include/scsi.h
> index 89ae45f..9681d19 100644
> --- a/include/scsi.h
> +++ b/include/scsi.h
> @@ -189,6 +189,8 @@ void scsi_low_level_init(int busdevfunc);
>  void scsi_init(void);
>  void scsi_scan(int mode);
>  
> +/** @return the number of scsi disks */
> +int scsi_get_disk_count(void);
>  
>  #define SCSI_IDENTIFY					0xC0  /* not used */
>  
> 

  reply	other threads:[~2012-10-19 12:16 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-19  3:44 [U-Boot] [PATCH 0/20] AHCI / SATA Improvements Simon Glass
2012-10-19  3:44 ` [U-Boot] [PATCH 01/20] ahci: Support splitting of read transactions into multiple chunks Simon Glass
2012-10-19  3:44 ` [U-Boot] [PATCH 02/20] scsi: Provide support for a list of AHCI controllers Simon Glass
2012-10-19  3:45 ` [U-Boot] [PATCH 03/20] scsi: Add scsi_write to SCSI driver Simon Glass
2012-10-19  3:45 ` [U-Boot] [PATCH 04/20] scsi: Add function to report number of scsi drives Simon Glass
2012-10-19 12:16   ` Rob Herring [this message]
2012-10-23  5:35     ` Simon Glass
2012-10-19  3:45 ` [U-Boot] [PATCH 05/20] ahci: Optimise AHCI controller reset and start-up Simon Glass
2012-10-19  3:45 ` [U-Boot] [PATCH 06/20] ahci: Improve AHCI debugging Simon Glass
2012-10-19  3:45 ` [U-Boot] [PATCH 07/20] ahci: cosmetics and cleanup Simon Glass
2012-10-19  3:45 ` [U-Boot] [PATCH 08/20] ahci: Make sending the SETFEATURES_XFER command optional Simon Glass
2012-10-19  3:45 ` [U-Boot] [PATCH 09/20] ahci: support scsi writing in AHCI driver Simon Glass
2012-10-19  3:45 ` [U-Boot] [PATCH 10/20] ahci: Make the AHCI code find the capacity of disks > 128 GB properly Simon Glass
2012-10-19  3:45 ` [U-Boot] [PATCH 11/20] ahci: Use sizeof(fis) instead of hardcoding '20' Simon Glass
2012-10-19  3:45 ` [U-Boot] [PATCH 12/20] ahci: Put all uses of ahci_set_feature() under CONFIG_AHCI_SETFEATURES_XFER Simon Glass
2012-10-19  3:45 ` [U-Boot] [PATCH 13/20] scsi: Put 'scsi_device_list' variable under CONFIG_PCI Simon Glass
2012-10-19  3:45 ` [U-Boot] [PATCH 14/20] ahci: Use virt_to_phys() to denote physical addresses for DMA Simon Glass
2012-10-19  3:45 ` [U-Boot] [PATCH 15/20] ahci: flush / invalidate dcache around SATA commands Simon Glass
2012-10-19  3:45 ` [U-Boot] [PATCH 16/20] ahci: Adjust SATA timeouts for hard disk (spinup delay & command timeout) Simon Glass
2012-10-19  3:45 ` [U-Boot] [PATCH 17/20] ahci: Support spin-up and link-up separately Simon Glass
2012-10-19  3:45 ` [U-Boot] [PATCH 18/20] ahci: Perform SATA flush after disk write Simon Glass
2012-10-19  3:45 ` [U-Boot] [PATCH 19/20] ahci: Expand HDD Logical Block addressability up to 32 bits Simon Glass
2012-10-19  3:45 ` [U-Boot] [PATCH 20/20] x86: config: Enable AHCI support for coreboot Simon Glass
2012-10-19  4:12   ` Graeme Russ
2012-10-23  5:34     ` Simon Glass
2012-10-23  5:38       ` Graeme Russ
2012-10-23  5:42         ` Simon Glass
2012-10-23  6:33           ` Graeme Russ
2012-10-26  2:36             ` Simon Glass
2012-10-26  4:15               ` Graeme Russ
2012-10-31 23:28                 ` Simon Glass
2012-10-26 20:16 ` [U-Boot] [PATCH 0/20] AHCI / SATA Improvements Tom Rini
2012-10-26 20:55   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50814498.8020105@gmail.com \
    --to=robherring2@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.