summaryrefslogtreecommitdiff
path: root/cmd/scsi.c
AgeCommit message (Collapse)Author
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2017-08-17dm: scsi: Adjust the 'scsi' command to use blk_common_cmd()Simon Glass
Instead of having separate code in the 'scsi' command, adjust it to use the common function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-28cmd: scsi: Fix null pointer dereference in 'scsi reset'Bin Meng
During 'scsi reset', scsi_bus_reset() is called with udevice pointed to NULL, which causes exception. As a temporary fix, disable the call for DM SCSI for now. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-11dm: scsi: Document and rename the scsi_scan() parameterSimon Glass
The 'mode' parameter is actually a flag to determine whether to display a list of devices found during the scan. Rename it to reflect this, add a function comment and adjust callers to use a boolean. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-07-11dm: scsi: Add a device pointer to scan_exec(), scsi_bus_reset()Simon Glass
With driver model these functions need a device pointer. Add one even when CONFIG_DM_SCSI is not defined. This avoids having ugly conditional function prototypes, When CONFIG_DM_SCSI is not defined we can just ignore the pointer. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2016-12-02cmd: scsi: Make private functions staticMichal Simek
Two functions should be static because they are not exported to any other file. Warnings were reported by sparse C=1. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-12-02scsi: Change scsi_scan() to be able to return valueMichal Simek
With DM_SCSI this function will return more than one return value to cover errors. Suggested-by: Simon Glass <sjg@chromium.org> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-17dm: scsi: Separate the non-command code into its own fileSimon Glass
At present the SCSI command code includes both the command-processing code and the core SCSI functions and data structures. Separate the latter into its own file, adding functions as needed to avoid the command code accessing data structures directly. This functions use the new legacy block functions. With this commit: - There is no CONFIG option referenced from the command code - The concept of a 'current SCSI device' is confined to the command code This will make it easier to convert this code to driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-05-17dm: scsi: Fix up code styleSimon Glass
Update the code style of this file so that it passes checkpatch.pl. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-05-17dm: scsi: Remove the forward declarationsSimon Glass
Reorder the code to avoid needing forward declarations. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-03-16cmd: scsi: Group the command portion together, guard with !CONFIG_SPL_BUILDTom Rini
When we switch to including all linker lists in SPL it is important to not include commands as that may lead to link errors due to other things we have already discarded. In this case, the SCSI code needs a lot of attention so for now just guard the command portions. Signed-off-by: Tom Rini <trini@konsulko.com>
2016-03-14dm: block: Rename device number member dev to devnumSimon Glass
This is a device number, and we want to use 'dev' to mean a driver model device. Rename the member. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2016-03-14dm: part: Rename some partition functionsSimon Glass
Rename three partition functions so that they start with part_. This makes it clear what they relate to. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@nvidia.com>
2016-03-14dm: Drop the block_dev_desc_t typedefSimon Glass
Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long and causes 80-column violations, rename it to struct blk_desc. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2016-01-25Remove the cmd_ prefix from command filesSimon Glass
Now that they are in their own directory, we can remove this prefix. This makes it easier to find a file since the prefix does not get in the way. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Heiko Schocher <hs@denx.de> Acked-by: Stefan Roese <sr@denx.de> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>