ahc_eisa.c (70204) | ahc_eisa.c (71390) |
---|---|
1/* 2 * FreeBSD, EISA product support functions 3 * 4 * 5 * Copyright (c) 1994, 1995, 1996, 1997, 1998, 2000 Justin T. Gibbs. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * $Id$ 30 * | 1/* 2 * FreeBSD, EISA product support functions 3 * 4 * 5 * Copyright (c) 1994, 1995, 1996, 1997, 1998, 2000 Justin T. Gibbs. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * $Id$ 30 * |
31 * $FreeBSD: head/sys/dev/aic7xxx/ahc_eisa.c 70204 2000-12-20 01:11:37Z gibbs $ | 31 * $FreeBSD: head/sys/dev/aic7xxx/ahc_eisa.c 71390 2001-01-22 21:03:48Z gibbs $ |
32 */ 33 34#include <dev/aic7xxx/aic7xxx_freebsd.h> 35 36#include <dev/eisa/eisaconf.h> 37 38static int 39aic7770_probe(device_t dev) --- 14 unchanged lines hidden (view full) --- 54 if (entry == NULL) 55 return (ENXIO); 56 device_set_desc(dev, entry->name); 57 58 iobase = (eisa_get_slot(dev) * EISA_SLOT_SIZE) + AHC_EISA_SLOT_OFFSET; 59 60 eisa_add_iospace(dev, iobase, AHC_EISA_IOSIZE, RESVADDR_NONE); 61 | 32 */ 33 34#include <dev/aic7xxx/aic7xxx_freebsd.h> 35 36#include <dev/eisa/eisaconf.h> 37 38static int 39aic7770_probe(device_t dev) --- 14 unchanged lines hidden (view full) --- 54 if (entry == NULL) 55 return (ENXIO); 56 device_set_desc(dev, entry->name); 57 58 iobase = (eisa_get_slot(dev) * EISA_SLOT_SIZE) + AHC_EISA_SLOT_OFFSET; 59 60 eisa_add_iospace(dev, iobase, AHC_EISA_IOSIZE, RESVADDR_NONE); 61 |
62 rid = 0; |
|
62 regs = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 63 0, ~0, 1, RF_ACTIVE); 64 if (regs == NULL) { 65 device_printf(dev, "Unable to map I/O space?!\n"); 66 return ENOMEM; 67 } 68 69 tag = rman_get_bustag(regs); --- 47 unchanged lines hidden (view full) --- 117 * Allocate a softc for this card and 118 * set it up for attachment by our 119 * common detect routine. 120 */ 121 name = malloc(strlen(device_get_nameunit(dev)) + 1, M_DEVBUF, M_NOWAIT); 122 if (name == NULL) 123 return (ENOMEM); 124 strcpy(name, device_get_nameunit(dev)); | 63 regs = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 64 0, ~0, 1, RF_ACTIVE); 65 if (regs == NULL) { 66 device_printf(dev, "Unable to map I/O space?!\n"); 67 return ENOMEM; 68 } 69 70 tag = rman_get_bustag(regs); --- 47 unchanged lines hidden (view full) --- 118 * Allocate a softc for this card and 119 * set it up for attachment by our 120 * common detect routine. 121 */ 122 name = malloc(strlen(device_get_nameunit(dev)) + 1, M_DEVBUF, M_NOWAIT); 123 if (name == NULL) 124 return (ENOMEM); 125 strcpy(name, device_get_nameunit(dev)); |
125 ahc = ahc_alloc(NULL, name); | 126 ahc = ahc_alloc(dev, name); |
126 if (ahc == NULL) 127 return (ENOMEM); 128 | 127 if (ahc == NULL) 128 return (ENOMEM); 129 |
130 ahc_set_unit(ahc, device_get_unit(dev)); 131 |
|
129 /* Allocate a dmatag for our SCB DMA maps */ 130 /* XXX Should be a child of the PCI bus dma tag */ 131 error = bus_dma_tag_create(/*parent*/NULL, /*alignment*/1, 132 /*boundary*/0, 133 /*lowaddr*/BUS_SPACE_MAXADDR_32BIT, 134 /*highaddr*/BUS_SPACE_MAXADDR, 135 /*filter*/NULL, /*filterarg*/NULL, 136 /*maxsize*/MAXBSIZE, /*nsegments*/AHC_NSEG, --- 19 unchanged lines hidden (view full) --- 156} 157 158int 159aic7770_map_registers(struct ahc_softc *ahc) 160{ 161 struct resource *regs; 162 int rid; 163 | 132 /* Allocate a dmatag for our SCB DMA maps */ 133 /* XXX Should be a child of the PCI bus dma tag */ 134 error = bus_dma_tag_create(/*parent*/NULL, /*alignment*/1, 135 /*boundary*/0, 136 /*lowaddr*/BUS_SPACE_MAXADDR_32BIT, 137 /*highaddr*/BUS_SPACE_MAXADDR, 138 /*filter*/NULL, /*filterarg*/NULL, 139 /*maxsize*/MAXBSIZE, /*nsegments*/AHC_NSEG, --- 19 unchanged lines hidden (view full) --- 159} 160 161int 162aic7770_map_registers(struct ahc_softc *ahc) 163{ 164 struct resource *regs; 165 int rid; 166 |
167 rid = 0; |
|
164 regs = bus_alloc_resource(ahc->dev_softc, SYS_RES_IOPORT, 165 &rid, 0, ~0, 1, RF_ACTIVE); 166 if (regs == NULL) { 167 device_printf(ahc->dev_softc, "Unable to map I/O space?!\n"); 168 return ENOMEM; 169 } 170 ahc->platform_data->regs_res_type = SYS_RES_IOPORT; 171 ahc->platform_data->regs_res_id = rid, --- 38 unchanged lines hidden --- | 168 regs = bus_alloc_resource(ahc->dev_softc, SYS_RES_IOPORT, 169 &rid, 0, ~0, 1, RF_ACTIVE); 170 if (regs == NULL) { 171 device_printf(ahc->dev_softc, "Unable to map I/O space?!\n"); 172 return ENOMEM; 173 } 174 ahc->platform_data->regs_res_type = SYS_RES_IOPORT; 175 ahc->platform_data->regs_res_id = rid, --- 38 unchanged lines hidden --- |