Deleted Added
full compact
cam_sim.c (168752) cam_sim.c (168864)
1/*-
2 * Common functions 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

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

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
29#include <sys/cdefs.h>
1/*-
2 * Common functions 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

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

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
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/cam/cam_sim.c 168752 2007-04-15 08:49:19Z scottl $");
30__FBSDID("$FreeBSD: head/sys/cam/cam_sim.c 168864 2007-04-19 14:28:43Z scottl $");
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/malloc.h>
35#include <sys/kernel.h>
36#include <sys/lock.h>
37#include <sys/mutex.h>
38

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

90 sim->flags |= 0;
91 callout_init(&sim->callout, 0);
92 } else {
93 sim->flags |= CAM_SIM_MPSAFE;
94 callout_init(&sim->callout, 1);
95 }
96
97 SLIST_INIT(&sim->ccb_freeq);
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/malloc.h>
35#include <sys/kernel.h>
36#include <sys/lock.h>
37#include <sys/mutex.h>
38

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

90 sim->flags |= 0;
91 callout_init(&sim->callout, 0);
92 } else {
93 sim->flags |= CAM_SIM_MPSAFE;
94 callout_init(&sim->callout, 1);
95 }
96
97 SLIST_INIT(&sim->ccb_freeq);
98 TAILQ_INIT(&sim->sim_doneq);
98
99 return (sim);
100}
101
102void
103cam_sim_free(struct cam_sim *sim, int free_devq)
104{
105 if (free_devq)
106 cam_simq_free(sim->devq);
107 free(sim, M_CAMSIM);
108}
109
110void
111cam_sim_set_path(struct cam_sim *sim, u_int32_t path_id)
112{
113 sim->path_id = path_id;
114}
99
100 return (sim);
101}
102
103void
104cam_sim_free(struct cam_sim *sim, int free_devq)
105{
106 if (free_devq)
107 cam_simq_free(sim->devq);
108 free(sim, M_CAMSIM);
109}
110
111void
112cam_sim_set_path(struct cam_sim *sim, u_int32_t path_id)
113{
114 sim->path_id = path_id;
115}