cam_xpt.h (b626f5a73a48f44a31a200291b141e1da408a2ff) cam_xpt.h (ab3e89f1ab134186362abe9848a855d5077fbd40)
1/*-
2 * Data structures and definitions for dealing with the
3 * Common Access Method Transport (xpt) layer.
4 *
5 * Copyright (c) 1997 Justin T. Gibbs.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 18 unchanged lines hidden (view full) ---

27 * SUCH DAMAGE.
28 *
29 * $FreeBSD$
30 */
31
32#ifndef _CAM_CAM_XPT_H
33#define _CAM_CAM_XPT_H 1
34
1/*-
2 * Data structures and definitions for dealing with the
3 * Common Access Method Transport (xpt) layer.
4 *
5 * Copyright (c) 1997 Justin T. Gibbs.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 18 unchanged lines hidden (view full) ---

27 * SUCH DAMAGE.
28 *
29 * $FreeBSD$
30 */
31
32#ifndef _CAM_CAM_XPT_H
33#define _CAM_CAM_XPT_H 1
34
35#include <sys/cdefs.h>
36#include "opt_printf.h"
37
35/* Forward Declarations */
36union ccb;
37struct cam_periph;
38struct cam_ed;
39struct cam_sim;
38/* Forward Declarations */
39union ccb;
40struct cam_periph;
41struct cam_ed;
42struct cam_sim;
43struct sbuf;
40
41/*
42 * Definition of a CAM path. Paths are created from bus, target, and lun ids
43 * via xpt_create_path and allow for reference to devices without recurring
44 * lookups in the edt.
45 */
46struct cam_path;
47
48/* Path functions */
49
50#ifdef _KERNEL
51
44
45/*
46 * Definition of a CAM path. Paths are created from bus, target, and lun ids
47 * via xpt_create_path and allow for reference to devices without recurring
48 * lookups in the edt.
49 */
50struct cam_path;
51
52/* Path functions */
53
54#ifdef _KERNEL
55
56/* Wild guess based on not wanting to grow the stack too much */
57#define XPT_PRINT_MAXLEN 512
58#ifdef PRINTF_BUFR_SIZE
59#define XPT_PRINT_LEN PRINTF_BUFR_SIZE
60#else
61#define XPT_PRINT_LEN 128
62#endif
63_Static_assert(XPT_PRINT_LEN <= XPT_PRINT_MAXLEN, "XPT_PRINT_LEN is too large");
64
52/*
53 * Definition of an async handler callback block. These are used to add
54 * SIMs and peripherals to the async callback lists.
55 */
56struct async_node {
57 SLIST_ENTRY(async_node) links;
58 u_int32_t event_enable; /* Async Event enables */
59 u_int32_t event_lock; /* Take SIM lock for handlers. */

--- 37 unchanged lines hidden (view full) ---

97 struct cam_path *path2);
98int xpt_path_comp_dev(struct cam_path *path,
99 struct cam_ed *dev);
100void xpt_print_path(struct cam_path *path);
101void xpt_print_device(struct cam_ed *device);
102void xpt_print(struct cam_path *path, const char *fmt, ...);
103int xpt_path_string(struct cam_path *path, char *str,
104 size_t str_len);
65/*
66 * Definition of an async handler callback block. These are used to add
67 * SIMs and peripherals to the async callback lists.
68 */
69struct async_node {
70 SLIST_ENTRY(async_node) links;
71 u_int32_t event_enable; /* Async Event enables */
72 u_int32_t event_lock; /* Take SIM lock for handlers. */

--- 37 unchanged lines hidden (view full) ---

110 struct cam_path *path2);
111int xpt_path_comp_dev(struct cam_path *path,
112 struct cam_ed *dev);
113void xpt_print_path(struct cam_path *path);
114void xpt_print_device(struct cam_ed *device);
115void xpt_print(struct cam_path *path, const char *fmt, ...);
116int xpt_path_string(struct cam_path *path, char *str,
117 size_t str_len);
118int xpt_path_sbuf(struct cam_path *path, struct sbuf *sb);
105path_id_t xpt_path_path_id(struct cam_path *path);
106target_id_t xpt_path_target_id(struct cam_path *path);
107lun_id_t xpt_path_lun_id(struct cam_path *path);
108struct cam_sim *xpt_path_sim(struct cam_path *path);
109struct cam_periph *xpt_path_periph(struct cam_path *path);
110void xpt_async(u_int32_t async_code, struct cam_path *path,
111 void *async_arg);
112void xpt_rescan(union ccb *ccb);

--- 28 unchanged lines hidden ---
119path_id_t xpt_path_path_id(struct cam_path *path);
120target_id_t xpt_path_target_id(struct cam_path *path);
121lun_id_t xpt_path_lun_id(struct cam_path *path);
122struct cam_sim *xpt_path_sim(struct cam_path *path);
123struct cam_periph *xpt_path_periph(struct cam_path *path);
124void xpt_async(u_int32_t async_code, struct cam_path *path,
125 void *async_arg);
126void xpt_rescan(union ccb *ccb);

--- 28 unchanged lines hidden ---