Deleted Added
full compact
mlx_disk.c (52273) mlx_disk.c (52544)
1/*-
2 * Copyright (c) 1999 Jonathan Lemon
3 * Copyright (c) 1999 Michael Smith
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

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

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

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD: head/sys/dev/mlx/mlx_disk.c 52273 1999-10-16 01:46:59Z msmith $
27 * $FreeBSD: head/sys/dev/mlx/mlx_disk.c 52544 1999-10-26 23:20:43Z msmith $
28 */
29
30/*
31 * Disk driver for Mylex DAC960 RAID adapters.
32 */
33
34#include <sys/param.h>
35#include <sys/systm.h>

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

43#include <sys/disk.h>
44
45#include <machine/bus.h>
46#include <machine/clock.h>
47#include <sys/rman.h>
48
49#include <dev/mlx/mlxio.h>
50#include <dev/mlx/mlxvar.h>
28 */
29
30/*
31 * Disk driver for Mylex DAC960 RAID adapters.
32 */
33
34#include <sys/param.h>
35#include <sys/systm.h>

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

43#include <sys/disk.h>
44
45#include <machine/bus.h>
46#include <machine/clock.h>
47#include <sys/rman.h>
48
49#include <dev/mlx/mlxio.h>
50#include <dev/mlx/mlxvar.h>
51#include <dev/mlx/mlxreg.h>
51
52#if 0
53#define debug(fmt, args...) printf("%s: " fmt "\n", __FUNCTION__ , ##args)
54#else
55#define debug(fmt, args...)
56#endif
57
58/* prototypes */

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

169 * arguments, and schedules the transfer. Does not wait for the transfer
170 * to complete. Multi-page transfers are supported. All I/O requests must
171 * be a multiple of a sector in length.
172 */
173static void
174mlxd_strategy(struct buf *bp)
175{
176 struct mlxd_softc *sc = (struct mlxd_softc *)bp->b_dev->si_drv1;
52
53#if 0
54#define debug(fmt, args...) printf("%s: " fmt "\n", __FUNCTION__ , ##args)
55#else
56#define debug(fmt, args...)
57#endif
58
59/* prototypes */

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

170 * arguments, and schedules the transfer. Does not wait for the transfer
171 * to complete. Multi-page transfers are supported. All I/O requests must
172 * be a multiple of a sector in length.
173 */
174static void
175mlxd_strategy(struct buf *bp)
176{
177 struct mlxd_softc *sc = (struct mlxd_softc *)bp->b_dev->si_drv1;
177 int s;
178
179 debug("called");
180
181 /* bogus disk? */
182 if (sc == NULL) {
183 bp->b_error = EINVAL;
184 goto bad;
185 }
186
187 /* XXX may only be temporarily offline - sleep? */
188 if (sc->mlxd_drive->ms_state == MLX_SYSD_OFFLINE) {
189 bp->b_error = ENXIO;
190 goto bad;
191 }
192
193 /* do-nothing operation */
194 if (bp->b_bcount == 0)
195 goto done;
196
178
179 debug("called");
180
181 /* bogus disk? */
182 if (sc == NULL) {
183 bp->b_error = EINVAL;
184 goto bad;
185 }
186
187 /* XXX may only be temporarily offline - sleep? */
188 if (sc->mlxd_drive->ms_state == MLX_SYSD_OFFLINE) {
189 bp->b_error = ENXIO;
190 goto bad;
191 }
192
193 /* do-nothing operation */
194 if (bp->b_bcount == 0)
195 goto done;
196
197 s = splbio();
198 devstat_start_transaction(&sc->mlxd_stats);
199 mlx_submit_buf(sc->mlxd_controller, bp);
197 devstat_start_transaction(&sc->mlxd_stats);
198 mlx_submit_buf(sc->mlxd_controller, bp);
200 splx(s);
201 return;
202
203 bad:
204 bp->b_flags |= B_ERROR;
205
206 done:
207 /*
208 * Correctly set the buf to indicate a completed transfer

--- 98 unchanged lines hidden ---
199 return;
200
201 bad:
202 bp->b_flags |= B_ERROR;
203
204 done:
205 /*
206 * Correctly set the buf to indicate a completed transfer

--- 98 unchanged lines hidden ---