aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/cam_periph.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cam/cam_periph.h')
-rw-r--r--sys/cam/cam_periph.h31
1 files changed, 16 insertions, 15 deletions
diff --git a/sys/cam/cam_periph.h b/sys/cam/cam_periph.h
index 9c323394797c..ad18ee6b204c 100644
--- a/sys/cam/cam_periph.h
+++ b/sys/cam/cam_periph.h
@@ -1,7 +1,7 @@
/*-
* Data structures and definitions for CAM peripheral ("type") drivers.
*
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 1997, 1998 Justin T. Gibbs.
* All rights reserved.
@@ -26,8 +26,6 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
#ifndef _CAM_CAM_PERIPH_H
@@ -124,9 +122,9 @@ struct cam_periph {
struct cam_path *path; /* Compiled path to device */
void *softc;
struct cam_sim *sim;
- u_int32_t unit_number;
+ uint32_t unit_number;
cam_periph_type type;
- u_int32_t flags;
+ uint32_t flags;
#define CAM_PERIPH_RUNNING 0x01
#define CAM_PERIPH_LOCKED 0x02
#define CAM_PERIPH_LOCK_WANTED 0x04
@@ -142,7 +140,7 @@ struct cam_periph {
uint32_t immediate_priority;
int periph_allocating;
int periph_allocated;
- u_int32_t refcount;
+ uint32_t refcount;
SLIST_HEAD(, ccb_hdr) ccb_list; /* For "immediate" requests */
SLIST_ENTRY(cam_periph) periph_links;
TAILQ_ENTRY(cam_periph) unit_links;
@@ -150,6 +148,7 @@ struct cam_periph {
ac_code deferred_ac;
struct task periph_run_task;
uma_zone_t ccb_zone;
+ struct root_hold_token periph_rootmount;
};
#define CAM_PERIPH_MAXMAPS 2
@@ -175,30 +174,32 @@ void cam_periph_release_locked(struct cam_periph *periph);
void cam_periph_release_locked_buses(struct cam_periph *periph);
int cam_periph_hold(struct cam_periph *periph, int priority);
void cam_periph_unhold(struct cam_periph *periph);
+void cam_periph_hold_boot(struct cam_periph *periph);
+void cam_periph_release_boot(struct cam_periph *periph);
void cam_periph_invalidate(struct cam_periph *periph);
int cam_periph_mapmem(union ccb *ccb,
struct cam_periph_map_info *mapinfo,
u_int maxmap);
-void cam_periph_unmapmem(union ccb *ccb,
+int cam_periph_unmapmem(union ccb *ccb,
struct cam_periph_map_info *mapinfo);
union ccb *cam_periph_getccb(struct cam_periph *periph,
- u_int32_t priority);
+ uint32_t priority);
int cam_periph_runccb(union ccb *ccb,
int (*error_routine)(union ccb *ccb,
cam_flags camflags,
- u_int32_t sense_flags),
- cam_flags camflags, u_int32_t sense_flags,
+ uint32_t sense_flags),
+ cam_flags camflags, uint32_t sense_flags,
struct devstat *ds);
int cam_periph_ioctl(struct cam_periph *periph, u_long cmd,
caddr_t addr,
int (*error_routine)(union ccb *ccb,
cam_flags camflags,
- u_int32_t sense_flags));
+ uint32_t sense_flags));
void cam_freeze_devq(struct cam_path *path);
-u_int32_t cam_release_devq(struct cam_path *path, u_int32_t relsim_flags,
- u_int32_t opening_reduction, u_int32_t arg,
+uint32_t cam_release_devq(struct cam_path *path, uint32_t relsim_flags,
+ uint32_t opening_reduction, uint32_t arg,
int getcount_only);
-void cam_periph_async(struct cam_periph *periph, u_int32_t code,
+void cam_periph_async(struct cam_periph *periph, uint32_t code,
struct cam_path *path, void *arg);
void cam_periph_bus_settle(struct cam_periph *periph,
u_int bus_settle_ms);
@@ -206,7 +207,7 @@ 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);
+ uint32_t sense_flags);
int cam_periph_invalidate_sysctl(SYSCTL_HANDLER_ARGS);
static __inline struct mtx *