Deleted Added
sdiff udiff text old ( 157943 ) new ( 160212 )
full compact
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 $");
32
33#include <sys/param.h>
34#include <sys/systm.h>
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
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);
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
252 /*
253 * Try and find firmware for this device.
254 */
255
256 if (isp_get_firmware_p) {
257 (*isp_get_firmware_p)(0, 0, 0x1000, &sbs->sbus_mdvec.dv_ispfw);
258 }
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 ---