isp_sbus.c (157943) | isp_sbus.c (160212) |
---|---|
1/*- 2 * PCI specific probe and attach routines for Qlogic ISP SCSI adapters. 3 * FreeBSD Version. 4 * 5 * Copyright (c) 1997-2006 by Matthew Jacob 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 30#include <sys/cdefs.h> | 1/*- 2 * PCI specific probe and attach routines for Qlogic ISP SCSI adapters. 3 * FreeBSD Version. 4 * 5 * Copyright (c) 1997-2006 by Matthew Jacob 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 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/isp/isp_sbus.c 157943 2006-04-21 18:30:01Z mjacob $"); | 31__FBSDID("$FreeBSD: head/sys/dev/isp/isp_sbus.c 160212 2006-07-09 17:50:20Z mjacob $"); |
32 33#include <sys/param.h> 34#include <sys/systm.h> | 32 33#include <sys/param.h> 34#include <sys/systm.h> |
35#if __FreeBSD_version >= 700000 36#include <sys/linker.h> 37#include <sys/firmware.h> 38#endif |
|
35#include <sys/bus.h> 36#include <sys/kernel.h> 37#include <sys/module.h> 38#include <sys/resource.h> 39 40#include <dev/ofw/ofw_bus.h> 41 42#include <machine/bus.h> --- 44 unchanged lines hidden (view full) --- 87 int16_t sbus_poff[_NREG_BLKS]; 88 bus_dma_tag_t dmat; 89 bus_dmamap_t *dmaps; 90 sdparam sbus_param; 91 struct ispmdvec sbus_mdvec; 92 struct resource * sbus_ires; 93}; 94 | 39#include <sys/bus.h> 40#include <sys/kernel.h> 41#include <sys/module.h> 42#include <sys/resource.h> 43 44#include <dev/ofw/ofw_bus.h> 45 46#include <machine/bus.h> --- 44 unchanged lines hidden (view full) --- 91 int16_t sbus_poff[_NREG_BLKS]; 92 bus_dma_tag_t dmat; 93 bus_dmamap_t *dmaps; 94 sdparam sbus_param; 95 struct ispmdvec sbus_mdvec; 96 struct resource * sbus_ires; 97}; 98 |
95extern ispfwfunc *isp_get_firmware_p; | |
96 97static device_method_t isp_sbus_methods[] = { 98 /* Device interface */ 99 DEVMETHOD(device_probe, isp_sbus_probe), 100 DEVMETHOD(device_attach, isp_sbus_attach), 101 { 0, 0 } 102}; 103static void isp_sbus_intr(void *); 104 105static driver_t isp_sbus_driver = { 106 "isp", isp_sbus_methods, sizeof (struct isp_sbussoftc) 107}; 108static devclass_t isp_devclass; 109DRIVER_MODULE(isp, sbus, isp_sbus_driver, isp_devclass, 0, 0); | 99 100static device_method_t isp_sbus_methods[] = { 101 /* Device interface */ 102 DEVMETHOD(device_probe, isp_sbus_probe), 103 DEVMETHOD(device_attach, isp_sbus_attach), 104 { 0, 0 } 105}; 106static void isp_sbus_intr(void *); 107 108static driver_t isp_sbus_driver = { 109 "isp", isp_sbus_methods, sizeof (struct isp_sbussoftc) 110}; 111static devclass_t isp_devclass; 112DRIVER_MODULE(isp, sbus, isp_sbus_driver, isp_devclass, 0, 0); |
113#if __FreeBSD_version >= 700000 114MODULE_DEPEND(isp, firmware, 1, 1, 1); 115#else 116typedef void ispfwfunc(int, int, int, uint16_t **); 117extern ispfwfunc *isp_get_firmware_p; 118#endif |
|
110 111static int 112isp_sbus_probe(device_t dev) 113{ 114 int found = 0; 115 const char *name = ofw_bus_get_name(dev); 116 if (strcmp(name, "SUNW,isp") == 0 || 117 strcmp(name, "QLGC,isp") == 0 || --- 126 unchanged lines hidden (view full) --- 244 } 245 246 /* 247 * We don't trust NVRAM on SBus cards 248 */ 249 isp->isp_confopts |= ISP_CFG_NONVRAM; 250 251 | 119 120static int 121isp_sbus_probe(device_t dev) 122{ 123 int found = 0; 124 const char *name = ofw_bus_get_name(dev); 125 if (strcmp(name, "SUNW,isp") == 0 || 126 strcmp(name, "QLGC,isp") == 0 || --- 126 unchanged lines hidden (view full) --- 253 } 254 255 /* 256 * We don't trust NVRAM on SBus cards 257 */ 258 isp->isp_confopts |= ISP_CFG_NONVRAM; 259 260 |
261#if __FreeBSD_version >= 700000 262 isp->isp_osinfo.fw = firmware_get("isp_1000"); 263 if (isp->isp_osinfo.fw) { 264 union { 265 const void *cp; 266 uint16_t *sp; 267 } stupid; 268 stupid.cp = isp->isp_osinfo.fw->data; 269 isp->isp_mdvec->dv_ispfw = stupid.sp; 270 } 271#else |
|
252 /* 253 * Try and find firmware for this device. 254 */ | 272 /* 273 * Try and find firmware for this device. 274 */ |
255 | |
256 if (isp_get_firmware_p) { 257 (*isp_get_firmware_p)(0, 0, 0x1000, &sbs->sbus_mdvec.dv_ispfw); 258 } | 275 if (isp_get_firmware_p) { 276 (*isp_get_firmware_p)(0, 0, 0x1000, &sbs->sbus_mdvec.dv_ispfw); 277 } |
278#endif |
|
259 260 iqd = 0; 261 sbs->sbus_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &iqd, 262 RF_ACTIVE | RF_SHAREABLE); 263 if (sbs->sbus_ires == NULL) { 264 device_printf(dev, "could not allocate interrupt\n"); 265 goto bad; 266 } --- 588 unchanged lines hidden --- | 279 280 iqd = 0; 281 sbs->sbus_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &iqd, 282 RF_ACTIVE | RF_SHAREABLE); 283 if (sbs->sbus_ires == NULL) { 284 device_printf(dev, "could not allocate interrupt\n"); 285 goto bad; 286 } --- 588 unchanged lines hidden --- |