Deleted Added
full compact
aac_cam.c (109208) aac_cam.c (110426)
1/*
2 * Copyright (c) 2002 Adaptec, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*
2 * Copyright (c) 2002 Adaptec, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/dev/aac/aac_cam.c 109208 2003-01-13 23:51:14Z scottl $
26 * $FreeBSD: head/sys/dev/aac/aac_cam.c 110426 2003-02-05 23:24:25Z scottl $
27 */
28
29/*
30 * CAM front-end for communicating with non-DASD devices
31 */
32
33#include "opt_aac.h"
34

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

57#include <sys/rman.h>
58
59#include <vm/vm.h>
60#include <vm/pmap.h>
61
62#include <dev/aac/aacreg.h>
63#include <dev/aac/aac_ioctl.h>
64#include <dev/aac/aacvar.h>
27 */
28
29/*
30 * CAM front-end for communicating with non-DASD devices
31 */
32
33#include "opt_aac.h"
34

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

57#include <sys/rman.h>
58
59#include <vm/vm.h>
60#include <vm/pmap.h>
61
62#include <dev/aac/aacreg.h>
63#include <dev/aac/aac_ioctl.h>
64#include <dev/aac/aacvar.h>
65#include <dev/aac/aac_cam.h>
66
67struct aac_cam {
68 device_t dev;
65
66struct aac_cam {
67 device_t dev;
69 struct aac_cam_inf *inf;
68 struct aac_sim *inf;
70 struct cam_sim *sim;
71 struct cam_path *path;
72};
73
74static int aac_cam_probe(device_t dev);
75static int aac_cam_attach(device_t dev);
76static int aac_cam_detach(device_t dev);
77static void aac_cam_action(struct cam_sim *, union ccb *);

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

109 debug_called(2);
110
111 return (0);
112}
113
114static int
115aac_cam_detach(device_t dev)
116{
69 struct cam_sim *sim;
70 struct cam_path *path;
71};
72
73static int aac_cam_probe(device_t dev);
74static int aac_cam_attach(device_t dev);
75static int aac_cam_detach(device_t dev);
76static void aac_cam_action(struct cam_sim *, union ccb *);

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

108 debug_called(2);
109
110 return (0);
111}
112
113static int
114aac_cam_detach(device_t dev)
115{
116 debug_called(2);
117
117
118 return (0);
118 return (EBUSY);
119}
120
121/*
122 * Register the driver as a CAM SIM
123 */
124static int
125aac_cam_attach(device_t dev)
126{
127 struct cam_devq *devq;
128 struct cam_sim *sim;
129 struct cam_path *path;
130 struct aac_cam *camsc;
119}
120
121/*
122 * Register the driver as a CAM SIM
123 */
124static int
125aac_cam_attach(device_t dev)
126{
127 struct cam_devq *devq;
128 struct cam_sim *sim;
129 struct cam_path *path;
130 struct aac_cam *camsc;
131 struct aac_cam_inf *inf;
131 struct aac_sim *inf;
132
133 debug_called(1);
134
135 camsc = (struct aac_cam *)device_get_softc(dev);
132
133 debug_called(1);
134
135 camsc = (struct aac_cam *)device_get_softc(dev);
136 inf = (struct aac_cam_inf *)device_get_ivars(dev);
136 inf = (struct aac_sim *)device_get_ivars(dev);
137 camsc->inf = inf;
138
139 devq = cam_simq_alloc(inf->TargetsPerBus);
140 if (devq == NULL)
141 return (EIO);
142
143 sim = cam_sim_alloc(aac_cam_action, aac_cam_poll, "aacp", camsc,
144 device_get_unit(dev), 1, 1, devq);

--- 452 unchanged lines hidden ---
137 camsc->inf = inf;
138
139 devq = cam_simq_alloc(inf->TargetsPerBus);
140 if (devq == NULL)
141 return (EIO);
142
143 sim = cam_sim_alloc(aac_cam_action, aac_cam_poll, "aacp", camsc,
144 device_get_unit(dev), 1, 1, devq);

--- 452 unchanged lines hidden ---