summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/cam
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-08-09 14:02:09 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-09-21 10:29:38 +0200
commitbb80d9df8bac71eedee1a6787ca63aef972a7e48 (patch)
tree1b5cb9443c5ead5706c35afb618abbbd1592315e /freebsd/sys/cam
parentUpdate to FreeBSD head 2017-10-01 (diff)
downloadrtems-libbsd-bb80d9df8bac71eedee1a6787ca63aef972a7e48.tar.bz2
Update to FreeBSD head 2017-12-01
Git mirror commit e724f51f811a4b2bd29447f8b85ab5c2f9b88266. Update #3472.
Diffstat (limited to 'freebsd/sys/cam')
-rw-r--r--freebsd/sys/cam/ata/ata_all.h2
-rw-r--r--freebsd/sys/cam/cam.c33
-rw-r--r--freebsd/sys/cam/cam.h2
-rw-r--r--freebsd/sys/cam/cam_ccb.h15
-rw-r--r--freebsd/sys/cam/cam_debug.h2
-rw-r--r--freebsd/sys/cam/cam_periph.h2
-rw-r--r--freebsd/sys/cam/cam_sim.h2
-rw-r--r--freebsd/sys/cam/cam_xpt.h2
-rw-r--r--freebsd/sys/cam/cam_xpt_sim.h2
-rw-r--r--freebsd/sys/cam/nvme/nvme_all.h5
-rw-r--r--freebsd/sys/cam/scsi/scsi_all.c2
11 files changed, 54 insertions, 15 deletions
diff --git a/freebsd/sys/cam/ata/ata_all.h b/freebsd/sys/cam/ata/ata_all.h
index a279aa91..087d6820 100644
--- a/freebsd/sys/cam/ata/ata_all.h
+++ b/freebsd/sys/cam/ata/ata_all.h
@@ -1,4 +1,6 @@
/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (c) 2009 Alexander Motin <mav@FreeBSD.org>
* All rights reserved.
*
diff --git a/freebsd/sys/cam/cam.c b/freebsd/sys/cam/cam.c
index b6bc10d3..5d07bebf 100644
--- a/freebsd/sys/cam/cam.c
+++ b/freebsd/sys/cam/cam.c
@@ -3,6 +3,8 @@
/*-
* Generic utility routines for the Common Access Method layer.
*
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (c) 1997 Justin T. Gibbs.
* All rights reserved.
*
@@ -237,29 +239,35 @@ cam_strmatch(const u_int8_t *str, const u_int8_t *pattern, int str_len)
return (1);
} else if (*pattern == '[') {
int negate_range, ok;
- uint8_t pc, sc;
+ uint8_t pc = UCHAR_MAX;
+ uint8_t sc;
ok = 0;
sc = *str++;
str_len--;
+ pattern++;
if ((negate_range = (*pattern == '^')) != 0)
pattern++;
- while (((pc = *pattern) != ']') && *pattern != '\0') {
- pattern++;
+ while ((*pattern != ']') && *pattern != '\0') {
if (*pattern == '-') {
if (pattern[1] == '\0') /* Bad pattern */
return (1);
if (sc >= pc && sc <= pattern[1])
ok = 1;
- pattern += 2;
- } else if (pc == sc)
+ pattern++;
+ } else if (*pattern == sc)
ok = 1;
+ pc = *pattern;
+ pattern++;
}
if (ok == negate_range)
return (1);
+ pattern++;
} else if (*pattern == '?') {
- /* NB: || *str == ' ' of the old code is a bug and was removed */
- /* if you add it back, keep this the last if before the naked else */
+ /*
+ * NB: || *str == ' ' of the old code is a bug and was
+ * removed. If you add it back, keep this the last if
+ * before the naked else */
pattern++;
str++;
str_len--;
@@ -271,6 +279,17 @@ cam_strmatch(const u_int8_t *str, const u_int8_t *pattern, int str_len)
str_len--;
}
}
+
+ /* '*' is allowed to match nothing, so gobble it */
+ while (*pattern == '*')
+ pattern++;
+
+ if ( *pattern != '\0') {
+ /* Pattern not fully consumed. Not a match */
+ return (1);
+ }
+
+ /* Eat trailing spaces, which get added by SAT */
while (str_len > 0 && *str == ' ') {
str++;
str_len--;
diff --git a/freebsd/sys/cam/cam.h b/freebsd/sys/cam/cam.h
index 4bd569be..4f9cddf3 100644
--- a/freebsd/sys/cam/cam.h
+++ b/freebsd/sys/cam/cam.h
@@ -1,6 +1,8 @@
/*-
* Data structures and definitions for the CAM system.
*
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (c) 1997 Justin T. Gibbs.
* All rights reserved.
*
diff --git a/freebsd/sys/cam/cam_ccb.h b/freebsd/sys/cam/cam_ccb.h
index 97560848..8e88b4a3 100644
--- a/freebsd/sys/cam/cam_ccb.h
+++ b/freebsd/sys/cam/cam_ccb.h
@@ -1,6 +1,8 @@
/*-
* Data structures and definitions for CAM Control Blocks (CCBs).
*
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (c) 1997, 1998 Justin T. Gibbs.
* All rights reserved.
*
@@ -1039,11 +1041,14 @@ struct ccb_trans_settings_nvme
u_int valid; /* Which fields to honor */
#define CTS_NVME_VALID_SPEC 0x01
#define CTS_NVME_VALID_CAPS 0x02
- u_int spec_major; /* Major version of spec supported */
- u_int spec_minor; /* Minor verison of spec supported */
- u_int spec_tiny; /* Tiny version of spec supported */
- u_int max_xfer; /* Max transfer size (0 -> unlimited */
- u_int caps;
+#define CTS_NVME_VALID_LINK 0x04
+ uint32_t spec; /* NVMe spec implemented -- same as vs register */
+ uint32_t max_xfer; /* Max transfer size (0 -> unlimited */
+ uint32_t caps;
+ uint8_t lanes; /* Number of PCIe lanes */
+ uint8_t speed; /* PCIe generation for each lane */
+ uint8_t max_lanes; /* Number of PCIe lanes */
+ uint8_t max_speed; /* PCIe generation for each lane */
};
#include <cam/mmc/mmc_bus.h>
diff --git a/freebsd/sys/cam/cam_debug.h b/freebsd/sys/cam/cam_debug.h
index 7b619a29..b88c6b20 100644
--- a/freebsd/sys/cam/cam_debug.h
+++ b/freebsd/sys/cam/cam_debug.h
@@ -1,6 +1,8 @@
/*-
* Macros for tracing/loging information in the CAM layer
*
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (c) 1997 Justin T. Gibbs.
* All rights reserved.
*
diff --git a/freebsd/sys/cam/cam_periph.h b/freebsd/sys/cam/cam_periph.h
index 87f153c3..b7f0618e 100644
--- a/freebsd/sys/cam/cam_periph.h
+++ b/freebsd/sys/cam/cam_periph.h
@@ -1,6 +1,8 @@
/*-
* Data structures and definitions for CAM peripheral ("type") drivers.
*
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (c) 1997, 1998 Justin T. Gibbs.
* All rights reserved.
*
diff --git a/freebsd/sys/cam/cam_sim.h b/freebsd/sys/cam/cam_sim.h
index 4c4c8c58..95dedb08 100644
--- a/freebsd/sys/cam/cam_sim.h
+++ b/freebsd/sys/cam/cam_sim.h
@@ -1,6 +1,8 @@
/*-
* Data structures and definitions for SCSI Interface Modules (SIMs).
*
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (c) 1997 Justin T. Gibbs.
* All rights reserved.
*
diff --git a/freebsd/sys/cam/cam_xpt.h b/freebsd/sys/cam/cam_xpt.h
index 47fdbd74..8baec294 100644
--- a/freebsd/sys/cam/cam_xpt.h
+++ b/freebsd/sys/cam/cam_xpt.h
@@ -2,6 +2,8 @@
* Data structures and definitions for dealing with the
* Common Access Method Transport (xpt) layer.
*
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (c) 1997 Justin T. Gibbs.
* All rights reserved.
*
diff --git a/freebsd/sys/cam/cam_xpt_sim.h b/freebsd/sys/cam/cam_xpt_sim.h
index c3575deb..87b57217 100644
--- a/freebsd/sys/cam/cam_xpt_sim.h
+++ b/freebsd/sys/cam/cam_xpt_sim.h
@@ -2,6 +2,8 @@
* Data structures and definitions for dealing with the
* Common Access Method Transport (xpt) layer.
*
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (c) 1997 Justin T. Gibbs.
* All rights reserved.
*
diff --git a/freebsd/sys/cam/nvme/nvme_all.h b/freebsd/sys/cam/nvme/nvme_all.h
index b52b7a78..b2db4833 100644
--- a/freebsd/sys/cam/nvme/nvme_all.h
+++ b/freebsd/sys/cam/nvme/nvme_all.h
@@ -33,15 +33,14 @@
struct ccb_nvmeio;
-#define NVME_REV_1 1 /* Supports NVMe 1.2 or earlier */
-
void nvme_ns_cmd(struct ccb_nvmeio *nvmeio, uint8_t cmd, uint32_t nsid,
uint32_t cdw10, uint32_t cdw11, uint32_t cdw12, uint32_t cdw13,
uint32_t cdw14, uint32_t cdw15);
int nvme_identify_match(caddr_t identbuffer, caddr_t table_entry);
-void nvme_print_ident(const struct nvme_controller_data *, const struct nvme_namespace_data *);
+struct sbuf;
+void nvme_print_ident(const struct nvme_controller_data *, const struct nvme_namespace_data *, struct sbuf *);
const char *nvme_op_string(const struct nvme_command *);
const char *nvme_cmd_string(const struct nvme_command *, char *, size_t);
const void *nvme_get_identify_cntrl(struct cam_periph *);
diff --git a/freebsd/sys/cam/scsi/scsi_all.c b/freebsd/sys/cam/scsi/scsi_all.c
index c13f5516..d344cc14 100644
--- a/freebsd/sys/cam/scsi/scsi_all.c
+++ b/freebsd/sys/cam/scsi/scsi_all.c
@@ -1,6 +1,8 @@
#include <machine/rtems-bsd-kernel-space.h>
/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Implementation of Utility functions for all SCSI device types.
*
* Copyright (c) 1997, 1998, 1999 Justin T. Gibbs.