git: 6b7580f7b1b6 - main - camcontrol: change hueristic for I/O-less devtype
Warner Losh
imp at FreeBSD.org
Tue Feb 23 19:57:52 UTC 2021
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/src/commit/?id=6b7580f7b1b66134286813b971ab575862b95426
commit 6b7580f7b1b66134286813b971ab575862b95426
Author: Warner Losh <imp at FreeBSD.org>
AuthorDate: 2021-02-23 19:33:26 +0000
Commit: Warner Losh <imp at FreeBSD.org>
CommitDate: 2021-02-23 19:56:15 +0000
camcontrol: change hueristic for I/O-less devtype
Some SATA drives have 'config' set to 0 in the identify block. Rather than rely
on it, use the strings windows uses to display the drive since they are supposed
to be space padded and will always be non-zero.
---
sbin/camcontrol/camcontrol.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c
index cc21a109343c..27d545d924b3 100644
--- a/sbin/camcontrol/camcontrol.c
+++ b/sbin/camcontrol/camcontrol.c
@@ -5520,9 +5520,14 @@ get_device_type(struct cam_device *dev, int retry_count, int timeout,
* For a retry count of -1, used only the cached data to avoid
* I/O to the drive. Sending the identify command to the drive
* can cause issues for SATL attachaed drives since identify is
- * not an NCQ command.
+ * not an NCQ command. We check for the strings that windows
+ * displays since those will not be NULs (they are supposed
+ * to be space padded). We could check other bits, but anything
+ * non-zero implies SATL.
*/
- if (cgd.ident_data.config != 0)
+ if (cgd.ident_data.serial[0] != 0 ||
+ cgd.ident_data.revision[0] != 0 ||
+ cgd.ident_data.model[0] != 0)
*devtype = CC_DT_SATL;
else
*devtype = CC_DT_SCSI;
More information about the dev-commits-src-all
mailing list