Deleted Added
sdiff udiff text old ( 153462 ) new ( 154704 )
full compact
1/*-
2 * PCI specific probe and attach routines for Qlogic ISP SCSI adapters.
3 * FreeBSD Version.
4 *
5 * Copyright (c) 1997, 1998, 1999, 2000, 2001 by Matthew Jacob
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice immediately at the beginning of the file, without modification,
12 * this list of conditions, and the following disclaimer.
13 * 2. The name of the author may not be used to endorse or promote products

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

19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/dev/isp/isp_pci.c 153462 2005-12-15 22:12:27Z jhb $");
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/kernel.h>
35#include <sys/module.h>
36#include <sys/bus.h>
37#include <sys/stdint.h>
38

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

215#ifndef PCI_PRODUCT_QLOGIC_ISP2300
216#define PCI_PRODUCT_QLOGIC_ISP2300 0x2300
217#endif
218
219#ifndef PCI_PRODUCT_QLOGIC_ISP2312
220#define PCI_PRODUCT_QLOGIC_ISP2312 0x2312
221#endif
222
223#ifndef PCI_PRODUCT_QLOGIC_ISP6312
224#define PCI_PRODUCT_QLOGIC_ISP6312 0x6312
225#endif
226
227#define PCI_QLOGIC_ISP1020 \
228 ((PCI_PRODUCT_QLOGIC_ISP1020 << 16) | PCI_VENDOR_QLOGIC)
229
230#define PCI_QLOGIC_ISP1080 \

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

249 ((PCI_PRODUCT_QLOGIC_ISP2200 << 16) | PCI_VENDOR_QLOGIC)
250
251#define PCI_QLOGIC_ISP2300 \
252 ((PCI_PRODUCT_QLOGIC_ISP2300 << 16) | PCI_VENDOR_QLOGIC)
253
254#define PCI_QLOGIC_ISP2312 \
255 ((PCI_PRODUCT_QLOGIC_ISP2312 << 16) | PCI_VENDOR_QLOGIC)
256
257#define PCI_QLOGIC_ISP6312 \
258 ((PCI_PRODUCT_QLOGIC_ISP6312 << 16) | PCI_VENDOR_QLOGIC)
259
260/*
261 * Odd case for some AMI raid cards... We need to *not* attach to this.
262 */
263#define AMI_RAID_SUBVENDOR_ID 0x101e
264

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

331 device_set_desc(dev, "Qlogic ISP 2200 PCI FC-AL Adapter");
332 break;
333 case PCI_QLOGIC_ISP2300:
334 device_set_desc(dev, "Qlogic ISP 2300 PCI FC-AL Adapter");
335 break;
336 case PCI_QLOGIC_ISP2312:
337 device_set_desc(dev, "Qlogic ISP 2312 PCI FC-AL Adapter");
338 break;
339 case PCI_QLOGIC_ISP6312:
340 device_set_desc(dev, "Qlogic ISP 6312 PCI FC-AL Adapter");
341 break;
342 default:
343 return (ENXIO);
344 }
345 if (isp_announced == 0 && bootverbose) {
346 printf("Qlogic ISP Driver, FreeBSD Version %d.%d, "

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

529 if (pci_get_devid(dev) == PCI_QLOGIC_ISP2312 ||
530 pci_get_devid(dev) == PCI_QLOGIC_ISP6312) {
531 mdvp = &mdvec_2300;
532 basetype = ISP_HA_FC_2312;
533 psize = sizeof (fcparam);
534 pcs->pci_poff[MBOX_BLOCK >> _BLK_REG_SHFT] =
535 PCI_MBOX_REGS2300_OFF;
536 }
537 isp = &pcs->pci_isp;
538 isp->isp_param = malloc(psize, M_DEVBUF, M_NOWAIT | M_ZERO);
539 if (isp->isp_param == NULL) {
540 device_printf(dev, "cannot allocate parameter data\n");
541 goto bad;
542 }
543 isp->isp_mdvec = mdvp;
544 isp->isp_type = basetype;
545 isp->isp_revision = pci_get_revid(dev);
546 isp->isp_role = role;
547 isp->isp_dev = dev;
548
549 /*
550 * Try and find firmware for this device.
551 */
552
553 if (isp_get_firmware_p) {
554 int device = (int) pci_get_device(dev);
555#ifdef ISP_TARGET_MODE
556 (*isp_get_firmware_p)(0, 1, device, &mdvp->dv_ispfw);
557#else
558 (*isp_get_firmware_p)(0, 0, device, &mdvp->dv_ispfw);
559#endif
560 }
561

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

739 isp->isp_dblev = ISP_LOGWARN|ISP_LOGERR;
740 }
741 if (bootverbose)
742 isp->isp_dblev |= ISP_LOGCONFIG|ISP_LOGINFO;
743
744 /*
745 * Last minute checks...
746 */
747 if (IS_2312(isp)) {
748 isp->isp_port = pci_get_function(dev);
749 }
750
751 /*
752 * Make sure we're in reset state.
753 */
754 ISP_LOCK(isp);
755 isp_reset(isp);

--- 1334 unchanged lines hidden ---