Deleted Added
full compact
amr_disk.c (148850) amr_disk.c (153409)
1/*-
2 * Copyright (c) 1999 Jonathan Lemon
3 * Copyright (c) 1999, 2000 Michael Smith
4 * Copyright (c) 2000 BSDi
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

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

51 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
53 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
54 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
55 * SUCH DAMAGE.
56 */
57
58#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1999 Jonathan Lemon
3 * Copyright (c) 1999, 2000 Michael Smith
4 * Copyright (c) 2000 BSDi
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

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

51 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
53 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
54 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
55 * SUCH DAMAGE.
56 */
57
58#include <sys/cdefs.h>
59__FBSDID("$FreeBSD: head/sys/dev/amr/amr_disk.c 148850 2005-08-08 12:16:21Z scottl $");
59__FBSDID("$FreeBSD: head/sys/dev/amr/amr_disk.c 153409 2005-12-14 03:26:49Z scottl $");
60
61/*
62 * Disk driver for AMI MegaRaid controllers
63 */
64
65#include <sys/param.h>
66#include <sys/systm.h>
67#include <sys/kernel.h>

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

84static int amrd_attach(device_t dev);
85static int amrd_detach(device_t dev);
86
87static disk_open_t amrd_open;
88static disk_strategy_t amrd_strategy;
89
90static devclass_t amrd_devclass;
91#ifdef FREEBSD_4
60
61/*
62 * Disk driver for AMI MegaRaid controllers
63 */
64
65#include <sys/param.h>
66#include <sys/systm.h>
67#include <sys/kernel.h>

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

84static int amrd_attach(device_t dev);
85static int amrd_detach(device_t dev);
86
87static disk_open_t amrd_open;
88static disk_strategy_t amrd_strategy;
89
90static devclass_t amrd_devclass;
91#ifdef FREEBSD_4
92static int disks_registered = 0;
92int amr_disks_registered = 0;
93#endif
94
95static device_method_t amrd_methods[] = {
96 DEVMETHOD(device_probe, amrd_probe),
97 DEVMETHOD(device_attach, amrd_attach),
98 DEVMETHOD(device_detach, amrd_detach),
99 { 0, 0 }
100};

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

252 struct amrd_softc *sc = (struct amrd_softc *)device_get_softc(dev);
253
254 debug_called(1);
255
256 if (sc->amrd_disk->d_flags & DISKFLAG_OPEN)
257 return(EBUSY);
258
259#ifdef FREEBSD_4
93#endif
94
95static device_method_t amrd_methods[] = {
96 DEVMETHOD(device_probe, amrd_probe),
97 DEVMETHOD(device_attach, amrd_attach),
98 DEVMETHOD(device_detach, amrd_detach),
99 { 0, 0 }
100};

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

252 struct amrd_softc *sc = (struct amrd_softc *)device_get_softc(dev);
253
254 debug_called(1);
255
256 if (sc->amrd_disk->d_flags & DISKFLAG_OPEN)
257 return(EBUSY);
258
259#ifdef FREEBSD_4
260 if (--disks_registered == 0)
260 if (--amr_disks_registered == 0)
261 cdevsw_remove(&amrddisk_cdevsw);
262#else
263 disk_destroy(sc->amrd_disk);
264#endif
265 return(0);
266}
267
261 cdevsw_remove(&amrddisk_cdevsw);
262#else
263 disk_destroy(sc->amrd_disk);
264#endif
265 return(0);
266}
267