summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/cam
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-08-20 15:53:03 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-09-21 10:29:39 +0200
commit18fa92c2dcc6c52e0bf27d214d80f0c25a89b47d (patch)
treea3020ac5b1f366f2f0920941b589808e435dbcee /freebsd/sys/cam
parentUpdate to FreeBSD head 2017-12-01 (diff)
downloadrtems-libbsd-18fa92c2dcc6c52e0bf27d214d80f0c25a89b47d.tar.bz2
Update to FreeBSD head 2018-02-01
Git mirror commit d079ae0442af8fa3cfd6d7ede190d04e64a2c0d4. Update #3472.
Diffstat (limited to 'freebsd/sys/cam')
-rw-r--r--freebsd/sys/cam/cam_ccb.h7
-rw-r--r--freebsd/sys/cam/cam_periph.h10
-rw-r--r--freebsd/sys/cam/cam_xpt.h18
-rw-r--r--freebsd/sys/cam/mmc/mmc.h2
-rw-r--r--freebsd/sys/cam/mmc/mmc_all.h2
-rw-r--r--freebsd/sys/cam/nvme/nvme_all.h2
-rw-r--r--freebsd/sys/cam/scsi/scsi_all.c4
7 files changed, 40 insertions, 5 deletions
diff --git a/freebsd/sys/cam/cam_ccb.h b/freebsd/sys/cam/cam_ccb.h
index 8e88b4a3..642e7862 100644
--- a/freebsd/sys/cam/cam_ccb.h
+++ b/freebsd/sys/cam/cam_ccb.h
@@ -519,7 +519,6 @@ struct device_match_result {
struct scsi_inquiry_data inq_data;
struct ata_params ident_data;
dev_result_flags flags;
- struct mmc_params mmc_ident_data;
};
struct bus_match_result {
@@ -646,6 +645,11 @@ struct ccb_pathinq_settings_sas {
struct ccb_pathinq_settings_nvme {
uint32_t nsid; /* Namespace ID for this path */
+ uint32_t domain;
+ uint8_t bus;
+ uint8_t slot;
+ uint8_t function;
+ uint8_t extra;
};
#define PATHINQ_SETTINGS_SIZE 128
@@ -1296,6 +1300,7 @@ struct ccb_dev_advinfo {
#define CDAI_TYPE_EXT_INQ 5
#define CDAI_TYPE_NVME_CNTRL 6 /* NVMe Identify Controller data */
#define CDAI_TYPE_NVME_NS 7 /* NVMe Identify Namespace data */
+#define CDAI_TYPE_MMC_PARAMS 8 /* MMC/SD ident */
off_t bufsiz; /* IN: Size of external buffer */
#define CAM_SCSI_DEVID_MAXLEN 65536 /* length in buffer is an uint16_t */
off_t provsiz; /* OUT: Size required/used */
diff --git a/freebsd/sys/cam/cam_periph.h b/freebsd/sys/cam/cam_periph.h
index b7f0618e..ee9a5fc0 100644
--- a/freebsd/sys/cam/cam_periph.h
+++ b/freebsd/sys/cam/cam_periph.h
@@ -197,12 +197,15 @@ void cam_periph_freeze_after_event(struct cam_periph *periph,
struct timeval* event_time,
u_int duration_ms);
int cam_periph_error(union ccb *ccb, cam_flags camflags,
- u_int32_t sense_flags, union ccb *save_ccb);
+ u_int32_t sense_flags);
static __inline struct mtx *
cam_periph_mtx(struct cam_periph *periph)
{
- return (xpt_path_mtx(periph->path));
+ if (periph != NULL)
+ return (xpt_path_mtx(periph->path));
+ else
+ return (NULL);
}
#define cam_periph_owned(periph) \
@@ -257,5 +260,8 @@ cam_periph_acquire_next(struct cam_periph *pperiph)
(periph) != NULL; \
(periph) = cam_periph_acquire_next(periph))
+#define CAM_PERIPH_PRINT(p, msg, args...) \
+ printf("%s%d:" msg, (periph)->periph_name, (periph)->unit_number, ##args)
+
#endif /* _KERNEL */
#endif /* _CAM_CAM_PERIPH_H */
diff --git a/freebsd/sys/cam/cam_xpt.h b/freebsd/sys/cam/cam_xpt.h
index 8baec294..fb49c893 100644
--- a/freebsd/sys/cam/cam_xpt.h
+++ b/freebsd/sys/cam/cam_xpt.h
@@ -36,8 +36,10 @@
#ifdef _KERNEL
#include <sys/cdefs.h>
+#include <cam/cam_ccb.h>
#endif
+
/* Forward Declarations */
union ccb;
struct cam_periph;
@@ -144,6 +146,22 @@ void xpt_copy_path(struct cam_path *new_path,
void xpt_release_path(struct cam_path *path);
const char * xpt_action_name(uint32_t action);
+void xpt_pollwait(union ccb *start_ccb, uint32_t timeout);
+uint32_t xpt_poll_setup(union ccb *start_ccb);
+
+/*
+ * Perform a path inquiry at the request priority. The bzero may be
+ * unnecessary.
+ */
+static inline void
+xpt_path_inq(struct ccb_pathinq *cpi, struct cam_path *path)
+{
+
+ bzero(cpi, sizeof(*cpi));
+ xpt_setup_ccb(&cpi->ccb_h, path, CAM_PRIORITY_NORMAL);
+ cpi->ccb_h.func_code = XPT_PATH_INQ;
+ xpt_action((union ccb *)cpi);
+}
#endif /* _KERNEL */
diff --git a/freebsd/sys/cam/mmc/mmc.h b/freebsd/sys/cam/mmc/mmc.h
index 2e31f029..9b9659fe 100644
--- a/freebsd/sys/cam/mmc/mmc.h
+++ b/freebsd/sys/cam/mmc/mmc.h
@@ -1,4 +1,6 @@
/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (c) 2014-2016 Ilya Bakulin. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/freebsd/sys/cam/mmc/mmc_all.h b/freebsd/sys/cam/mmc/mmc_all.h
index c2494894..cbc32c0d 100644
--- a/freebsd/sys/cam/mmc/mmc_all.h
+++ b/freebsd/sys/cam/mmc/mmc_all.h
@@ -1,4 +1,6 @@
/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (c) 2014-2016 Ilya Bakulin. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/freebsd/sys/cam/nvme/nvme_all.h b/freebsd/sys/cam/nvme/nvme_all.h
index b2db4833..fa229846 100644
--- a/freebsd/sys/cam/nvme/nvme_all.h
+++ b/freebsd/sys/cam/nvme/nvme_all.h
@@ -1,4 +1,6 @@
/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (c) 2015 Netflix, Inc
* All rights reserved.
*
diff --git a/freebsd/sys/cam/scsi/scsi_all.c b/freebsd/sys/cam/scsi/scsi_all.c
index d344cc14..1a469f32 100644
--- a/freebsd/sys/cam/scsi/scsi_all.c
+++ b/freebsd/sys/cam/scsi/scsi_all.c
@@ -1,10 +1,10 @@
#include <machine/rtems-bsd-kernel-space.h>
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
- *
* Implementation of Utility functions for all SCSI device types.
*
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (c) 1997, 1998, 1999 Justin T. Gibbs.
* Copyright (c) 1997, 1998, 2003 Kenneth D. Merry.
* All rights reserved.