cam_sim.h (139743) | cam_sim.h (168752) |
---|---|
1/*- 2 * Data structures and definitions for SCSI Interface Modules (SIMs). 3 * 4 * Copyright (c) 1997 Justin T. Gibbs. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/*- 2 * Data structures and definitions for SCSI Interface Modules (SIMs). 3 * 4 * Copyright (c) 1997 Justin T. Gibbs. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/cam/cam_sim.h 139743 2005-01-05 22:34:37Z imp $ | 28 * $FreeBSD: head/sys/cam/cam_sim.h 168752 2007-04-15 08:49:19Z scottl $ |
29 */ 30 31#ifndef _CAM_CAM_SIM_H 32#define _CAM_CAM_SIM_H 1 33 34#ifdef _KERNEL 35 36/* --- 14 unchanged lines hidden (view full) --- 51struct cam_devq * cam_simq_alloc(u_int32_t max_sim_transactions); 52void cam_simq_free(struct cam_devq *devq); 53 54struct cam_sim * cam_sim_alloc(sim_action_func sim_action, 55 sim_poll_func sim_poll, 56 const char *sim_name, 57 void *softc, 58 u_int32_t unit, | 29 */ 30 31#ifndef _CAM_CAM_SIM_H 32#define _CAM_CAM_SIM_H 1 33 34#ifdef _KERNEL 35 36/* --- 14 unchanged lines hidden (view full) --- 51struct cam_devq * cam_simq_alloc(u_int32_t max_sim_transactions); 52void cam_simq_free(struct cam_devq *devq); 53 54struct cam_sim * cam_sim_alloc(sim_action_func sim_action, 55 sim_poll_func sim_poll, 56 const char *sim_name, 57 void *softc, 58 u_int32_t unit, |
59 struct mtx *mtx, |
|
59 int max_dev_transactions, 60 int max_tagged_dev_transactions, 61 struct cam_devq *queue); 62void cam_sim_free(struct cam_sim *sim, int free_devq); 63 64/* Optional sim attributes may be set with these. */ 65void cam_sim_set_path(struct cam_sim *sim, u_int32_t path_id); 66 --- 18 unchanged lines hidden (view full) --- 85 * The sim driver should not access anything directly from this 86 * structure. 87 */ 88struct cam_sim { 89 sim_action_func sim_action; 90 sim_poll_func sim_poll; 91 const char *sim_name; 92 void *softc; | 60 int max_dev_transactions, 61 int max_tagged_dev_transactions, 62 struct cam_devq *queue); 63void cam_sim_free(struct cam_sim *sim, int free_devq); 64 65/* Optional sim attributes may be set with these. */ 66void cam_sim_set_path(struct cam_sim *sim, u_int32_t path_id); 67 --- 18 unchanged lines hidden (view full) --- 86 * The sim driver should not access anything directly from this 87 * structure. 88 */ 89struct cam_sim { 90 sim_action_func sim_action; 91 sim_poll_func sim_poll; 92 const char *sim_name; 93 void *softc; |
94 struct mtx *mtx; |
|
93 u_int32_t path_id;/* The Boot device may set this to 0? */ 94 u_int32_t unit_number; 95 u_int32_t bus_id; 96 int max_tagged_dev_openings; 97 int max_dev_openings; 98 u_int32_t flags; | 95 u_int32_t path_id;/* The Boot device may set this to 0? */ 96 u_int32_t unit_number; 97 u_int32_t bus_id; 98 int max_tagged_dev_openings; 99 int max_dev_openings; 100 u_int32_t flags; |
99#define CAM_SIM_REL_TIMEOUT_PENDING 0x01 100 struct callout_handle c_handle; | 101#define CAM_SIM_REL_TIMEOUT_PENDING 0x01 102#define CAM_SIM_MPSAFE 0x02 103 struct callout callout; |
101 struct cam_devq *devq; /* Device Queue to use for this SIM */ | 104 struct cam_devq *devq; /* Device Queue to use for this SIM */ |
105 106 /* "Pool" of inactive ccbs managed by xpt_alloc_ccb and xpt_free_ccb */ 107 SLIST_HEAD(,ccb_hdr) ccb_freeq; 108 /* 109 * Maximum size of ccb pool. Modified as devices are added/removed 110 * or have their * opening counts changed. 111 */ 112 u_int max_ccbs; 113 /* Current count of allocated ccbs */ 114 u_int ccb_count; 115 |
|
102}; 103 | 116}; 117 |
118#define CAM_SIM_LOCK(sim) mtx_lock((sim)->mtx); 119#define CAM_SIM_UNLOCK(sim) mtx_unlock((sim)->mtx); 120 |
|
104static __inline u_int32_t 105cam_sim_path(struct cam_sim *sim) 106{ 107 return (sim->path_id); 108} 109 110static __inline const char * 111cam_sim_name(struct cam_sim *sim) --- 24 unchanged lines hidden --- | 121static __inline u_int32_t 122cam_sim_path(struct cam_sim *sim) 123{ 124 return (sim->path_id); 125} 126 127static __inline const char * 128cam_sim_name(struct cam_sim *sim) --- 24 unchanged lines hidden --- |