Deleted Added
full compact
cam_sim.c (71507) cam_sim.c (109623)
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

--- 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 * 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

--- 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.c 71507 2001-01-24 01:46:18Z jhb $
28 * $FreeBSD: head/sys/cam/cam_sim.c 109623 2003-01-21 08:56:16Z alfred $
29 */
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/malloc.h>
34
35#include <cam/cam.h>
36#include <cam/cam_ccb.h>

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

62 /*
63 * If this is the xpt layer creating a sim, then it's OK
64 * to wait for an allocation.
65 *
66 * XXX Should we pass in a flag to indicate that wait is OK?
67 */
68 if (strcmp(sim_name, "xpt") == 0)
69 sim = (struct cam_sim *)malloc(sizeof(struct cam_sim),
29 */
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/malloc.h>
34
35#include <cam/cam.h>
36#include <cam/cam_ccb.h>

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

62 /*
63 * If this is the xpt layer creating a sim, then it's OK
64 * to wait for an allocation.
65 *
66 * XXX Should we pass in a flag to indicate that wait is OK?
67 */
68 if (strcmp(sim_name, "xpt") == 0)
69 sim = (struct cam_sim *)malloc(sizeof(struct cam_sim),
70 M_DEVBUF, M_WAITOK);
70 M_DEVBUF, 0);
71 else
72 sim = (struct cam_sim *)malloc(sizeof(struct cam_sim),
73 M_DEVBUF, M_NOWAIT);
74
75 if (sim != NULL) {
76 sim->sim_action = sim_action;
77 sim->sim_poll = sim_poll;
78 sim->sim_name = sim_name;

--- 27 unchanged lines hidden ---
71 else
72 sim = (struct cam_sim *)malloc(sizeof(struct cam_sim),
73 M_DEVBUF, M_NOWAIT);
74
75 if (sim != NULL) {
76 sim->sim_action = sim_action;
77 sim->sim_poll = sim_poll;
78 sim->sim_name = sim_name;

--- 27 unchanged lines hidden ---