Deleted Added
full compact
ata-isa.c (145000) ata-isa.c (145499)
1/*-
2 * Copyright (c) 1998 - 2005 S�ren Schmidt <sos@FreeBSD.org>
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

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

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1998 - 2005 S�ren Schmidt <sos@FreeBSD.org>
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

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

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/dev/ata/ata-isa.c 145000 2005-04-13 07:14:17Z sos $");
30__FBSDID("$FreeBSD: head/sys/dev/ata/ata-isa.c 145499 2005-04-25 07:57:04Z sos $");
31
32#include "opt_ata.h"
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/ata.h>
36#include <sys/kernel.h>
37#include <sys/module.h>
38#include <sys/bus.h>

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

68 int i, rid;
69
70 /* check isapnp ids */
71 if (ISA_PNP_PROBE(device_get_parent(dev), dev, ata_ids) == ENXIO)
72 return ENXIO;
73
74 /* allocate the io port range */
75 rid = ATA_IOADDR_RID;
31
32#include "opt_ata.h"
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/ata.h>
36#include <sys/kernel.h>
37#include <sys/module.h>
38#include <sys/bus.h>

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

68 int i, rid;
69
70 /* check isapnp ids */
71 if (ISA_PNP_PROBE(device_get_parent(dev), dev, ata_ids) == ENXIO)
72 return ENXIO;
73
74 /* allocate the io port range */
75 rid = ATA_IOADDR_RID;
76 io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0,
77 ATA_IOSIZE, RF_ACTIVE);
78 if (!io)
76 if (!(io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0,
77 ATA_IOSIZE, RF_ACTIVE)))
79 return ENXIO;
80
81 /* set the altport range */
82 if (bus_get_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID, &tmp, &tmp)) {
83 bus_set_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID,
84 rman_get_start(io) + ATA_CTLOFFSET, ATA_CTLIOSIZE);
85 }
86
87 /* allocate the altport range */
88 rid = ATA_CTLADDR_RID;
78 return ENXIO;
79
80 /* set the altport range */
81 if (bus_get_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID, &tmp, &tmp)) {
82 bus_set_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID,
83 rman_get_start(io) + ATA_CTLOFFSET, ATA_CTLIOSIZE);
84 }
85
86 /* allocate the altport range */
87 rid = ATA_CTLADDR_RID;
89 ctlio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0,
90 ATA_CTLIOSIZE, RF_ACTIVE);
91 if (!ctlio) {
88 if (!(ctlio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0,
89 ATA_CTLIOSIZE, RF_ACTIVE))) {
92 bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, io);
93 return ENXIO;
94 }
95
96 /* setup the resource vectors */
97 for (i = ATA_DATA; i <= ATA_COMMAND; i++) {
98 ch->r_io[i].res = io;
99 ch->r_io[i].offset = i;

--- 43 unchanged lines hidden ---
90 bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, io);
91 return ENXIO;
92 }
93
94 /* setup the resource vectors */
95 for (i = ATA_DATA; i <= ATA_COMMAND; i++) {
96 ch->r_io[i].res = io;
97 ch->r_io[i].offset = i;

--- 43 unchanged lines hidden ---