p4-projects@freebsd.org
[Top] [All Lists]

PERFORCE change 101214 for review

Subject: PERFORCE change 101214 for review
From: John Baldwin
Date: Mon, 10 Jul 2006 17:03:10 GMT
http://perforce.freebsd.org/chv.cgi?CH=101214

Change 101214 by jhb@jhb_mutex on 2006/07/10 17:02:52

        IFC @101211.

Affected files ...

.. //depot/projects/smpng/sys/amd64/conf/GENERIC#50 integrate
.. //depot/projects/smpng/sys/conf/NOTES#123 integrate
.. //depot/projects/smpng/sys/contrib/pf/net/if_pflog.c#15 integrate
.. //depot/projects/smpng/sys/contrib/pf/net/if_pfsync.c#22 integrate
.. //depot/projects/smpng/sys/dev/asr/MAINTAINER#4 delete
.. //depot/projects/smpng/sys/dev/isp/isp_freebsd.c#41 integrate
.. //depot/projects/smpng/sys/dev/isp/isp_freebsd.h#31 integrate
.. //depot/projects/smpng/sys/dev/isp/isp_pci.c#37 integrate
.. //depot/projects/smpng/sys/dev/isp/isp_sbus.c#14 integrate
.. //depot/projects/smpng/sys/dev/ispfw/asm_1040.h#3 integrate
.. //depot/projects/smpng/sys/dev/ispfw/asm_1080.h#3 integrate
.. //depot/projects/smpng/sys/dev/ispfw/asm_12160.h#5 integrate
.. //depot/projects/smpng/sys/dev/ispfw/ispfw.c#13 integrate
.. //depot/projects/smpng/sys/geom/raid3/g_raid3.c#31 integrate
.. //depot/projects/smpng/sys/i386/conf/GENERIC#80 integrate
.. //depot/projects/smpng/sys/i386/conf/PAE#19 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_proto.h#13 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_syscall.h#12 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/ibcs2_sysent.c#14 integrate
.. //depot/projects/smpng/sys/i386/ibcs2/syscalls.master#14 integrate
.. //depot/projects/smpng/sys/i386/include/i4b_ioctl.h#11 integrate
.. //depot/projects/smpng/sys/i4b/layer4/i4b_l4mgmt.c#8 integrate
.. //depot/projects/smpng/sys/ia64/conf/GENERIC#52 integrate
.. //depot/projects/smpng/sys/kern/kern_environment.c#22 integrate
.. //depot/projects/smpng/sys/kern/subr_hints.c#10 integrate
.. //depot/projects/smpng/sys/modules/ispfw/Makefile#2 integrate
.. //depot/projects/smpng/sys/modules/ispfw/isp_1000/Makefile#1 branch
.. //depot/projects/smpng/sys/modules/ispfw/isp_1040/Makefile#1 branch
.. //depot/projects/smpng/sys/modules/ispfw/isp_1040_it/Makefile#1 branch
.. //depot/projects/smpng/sys/modules/ispfw/isp_1080/Makefile#1 branch
.. //depot/projects/smpng/sys/modules/ispfw/isp_1080_it/Makefile#1 branch
.. //depot/projects/smpng/sys/modules/ispfw/isp_12160/Makefile#1 branch
.. //depot/projects/smpng/sys/modules/ispfw/isp_12160_it/Makefile#1 branch
.. //depot/projects/smpng/sys/modules/ispfw/isp_2100/Makefile#1 branch
.. //depot/projects/smpng/sys/modules/ispfw/isp_2200/Makefile#1 branch
.. //depot/projects/smpng/sys/modules/ispfw/isp_2300/Makefile#1 branch
.. //depot/projects/smpng/sys/modules/ispfw/isp_2322/Makefile#1 branch
.. //depot/projects/smpng/sys/modules/ispfw/ispfw/Makefile#1 branch
.. //depot/projects/smpng/sys/net/if.c#85 integrate
.. //depot/projects/smpng/sys/net/if_bridge.c#32 integrate
.. //depot/projects/smpng/sys/net/if_clone.c#10 integrate
.. //depot/projects/smpng/sys/net/if_clone.h#4 integrate
.. //depot/projects/smpng/sys/net/if_disc.c#23 integrate
.. //depot/projects/smpng/sys/net/if_enc.c#4 integrate
.. //depot/projects/smpng/sys/net/if_faith.c#32 integrate
.. //depot/projects/smpng/sys/net/if_gif.c#35 integrate
.. //depot/projects/smpng/sys/net/if_gre.c#31 integrate
.. //depot/projects/smpng/sys/net/if_loop.c#40 integrate
.. //depot/projects/smpng/sys/net/if_ppp.c#41 integrate
.. //depot/projects/smpng/sys/net/if_stf.c#37 integrate
.. //depot/projects/smpng/sys/net/if_vlan.c#50 integrate
.. //depot/projects/smpng/sys/netinet/ip_carp.c#19 integrate
.. //depot/projects/smpng/sys/pc98/conf/GENERIC#64 integrate
.. //depot/projects/smpng/sys/powerpc/powerpc/mmu_oea.c#6 integrate
.. //depot/projects/smpng/sys/sparc64/conf/GENERIC#71 integrate
.. //depot/projects/smpng/sys/sys/sockio.h#12 integrate
.. //depot/projects/smpng/sys/sys/systm.h#71 integrate
.. //depot/projects/smpng/sys/ufs/ffs/ffs_vfsops.c#87 integrate
.. //depot/projects/smpng/sys/vm/vm_meter.c#29 integrate

Differences ...

==== //depot/projects/smpng/sys/amd64/conf/GENERIC#50 (text+ko) ====

@@ -16,7 +16,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first
 # in NOTES.
 #
-# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.463 2006/07/05 02:32:55 davidxu Exp 
$
+# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.464 2006/07/09 16:39:21 mjacob Exp $
 
 cpu            HAMMER
 ident          GENERIC
@@ -251,6 +251,7 @@
 device         md              # Memory "disks"
 device         gif             # IPv6 and IPv4 tunneling
 device         faith           # IPv6-to-IPv4 relaying (translation)
+device         firmware        # firmware assist module
 
 # The `bpf' device enables the Berkeley Packet Filter.
 # Be aware of the administrative consequences of enabling this!

==== //depot/projects/smpng/sys/conf/NOTES#123 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/NOTES,v 1.1370 2006/06/27 12:45:27 glebius Exp $
+# $FreeBSD: src/sys/conf/NOTES,v 1.1371 2006/07/10 05:25:18 thompsa Exp $
 #
 # NOTES -- Lines that can be cut/pasted into kernel and hints configs.
 #
@@ -668,6 +668,7 @@
 device         pflog                   #logging support interface for PF
 device         pfsync                  #synchronization interface for PF
 device         carp                    #Common Address Redundancy Protocol
+device         enc                     #IPSec interface (needs FAST_IPSEC)
 device         ppp                     #Point-to-point protocol
 options        PPP_BSDCOMP             #PPP BSD-compress support
 options        PPP_DEFLATE             #PPP zlib/deflate/gzip support

==== //depot/projects/smpng/sys/contrib/pf/net/if_pflog.c#15 (text+ko) ====

@@ -1,4 +1,4 @@
-/*     $FreeBSD: src/sys/contrib/pf/net/if_pflog.c,v 1.19 2006/02/05 17:17:32 
mlaier Exp $     */
+/*     $FreeBSD: src/sys/contrib/pf/net/if_pflog.c,v 1.20 2006/07/09 06:04:01 
sam Exp $        */
 /*     $OpenBSD: if_pflog.c,v 1.12 2004/05/19 17:50:51 dhartmei Exp $  */
 
 /*
@@ -121,7 +121,7 @@
 
 #ifdef __FreeBSD__
 static void    pflog_clone_destroy(struct ifnet *);
-static int     pflog_clone_create(struct if_clone *, int);
+static int     pflog_clone_create(struct if_clone *, int, caddr_t);
 #else
 void   pflogattach(int);
 #endif
@@ -161,7 +161,11 @@
 }
 
 static int
+#ifdef __FreeBSD__
+pflog_clone_create(struct if_clone *ifc, int unit, caddr_t params)
+#else
 pflog_clone_create(struct if_clone *ifc, int unit)
+#endif
 {
        struct pflog_softc *sc;
        struct ifnet *ifp;

==== //depot/projects/smpng/sys/contrib/pf/net/if_pfsync.c#22 (text+ko) ====

@@ -1,4 +1,4 @@
-/*     $FreeBSD: src/sys/contrib/pf/net/if_pfsync.c,v 1.29 2006/07/08 00:01:01 
mlaier Exp $    */
+/*     $FreeBSD: src/sys/contrib/pf/net/if_pfsync.c,v 1.30 2006/07/09 06:04:01 
sam Exp $       */
 /*     $OpenBSD: if_pfsync.c,v 1.46 2005/02/20 15:58:38 mcbride Exp $  */
 
 /*
@@ -148,7 +148,7 @@
  */
 
 static void    pfsync_clone_destroy(struct ifnet *);
-static int     pfsync_clone_create(struct if_clone *, int);
+static int     pfsync_clone_create(struct if_clone *, int, caddr_t params);
 static void    pfsync_senddef(void *);
 #else
 void   pfsyncattach(int);
@@ -205,7 +205,11 @@
 }
 
 static int
+#ifdef __FreeBSD__
+pfsync_clone_create(struct if_clone *ifc, int unit, caddr_t params)
+#else
 pfsync_clone_create(struct if_clone *ifc, int unit)
+#endif
 {
        struct pfsync_softc *sc;
        struct ifnet *ifp;

==== //depot/projects/smpng/sys/dev/isp/isp_freebsd.c#41 (text+ko) ====

@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.117 2006/05/30 17:43:04 
mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.118 2006/07/09 17:50:17 
mjacob Exp $");
 
 #include <dev/isp/isp_freebsd.h>
 #include <sys/unistd.h>
@@ -42,7 +42,6 @@
 MODULE_VERSION(isp, 1);
 MODULE_DEPEND(isp, cam, 1, 1, 1);
 int isp_announced = 0;
-ispfwfunc *isp_get_firmware_p = NULL;
 
 static d_ioctl_t ispioctl;
 static void isp_intr_enable(void *);

==== //depot/projects/smpng/sys/dev/isp/isp_freebsd.h#31 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/dev/isp/isp_freebsd.h,v 1.90 2006/06/03 07:19:44 mjacob 
Exp $ */
+/* $FreeBSD: src/sys/dev/isp/isp_freebsd.h,v 1.91 2006/07/09 17:50:17 mjacob 
Exp $ */
 /*-
  * Qlogic ISP SCSI Host Adapter FreeBSD Wrapper Definitions
  *
@@ -97,8 +97,6 @@
 #endif
 #endif
 
-typedef void ispfwfunc(int, int, int, uint16_t **);
-
 #ifdef ISP_TARGET_MODE
 #define        ISP_TARGET_FUNCTIONS    1
 #define        ATPDPSIZE       256
@@ -155,6 +153,7 @@
                intsok          : 1,
                simqfrozen      : 3;
 #if __FreeBSD_version >= 500000  
+       struct firmware *       fw;
        struct mtx              lock;
        struct cv               kthread_cv;
 #endif

==== //depot/projects/smpng/sys/dev/isp/isp_pci.c#37 (text+ko) ====

@@ -29,15 +29,18 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/isp/isp_pci.c,v 1.115 2006/07/03 08:24:09 
mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/isp/isp_pci.c,v 1.116 2006/07/09 17:50:17 
mjacob Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/module.h>
+#if __FreeBSD_version >= 700000  
+#include <sys/linker.h>
+#include <sys/firmware.h>
+#endif
 #include <sys/bus.h>
 #if __FreeBSD_version < 500000  
-#include <sys/bus.h>
 #include <pci/pcireg.h>
 #include <pci/pcivar.h>
 #include <machine/bus_memio.h>
@@ -72,6 +75,7 @@
 static void
 isp_pci_dmateardown(ispsoftc_t *, XS_T *, uint16_t);
 
+
 static void isp_pci_reset1(ispsoftc_t *);
 static void isp_pci_dumpregs(ispsoftc_t *, const char *);
 
@@ -241,6 +245,11 @@
 #define        PCI_PRODUCT_QLOGIC_ISP6312      0x6312
 #endif
 
+#ifndef        PCI_PRODUCT_QLOGIC_ISP6322
+#define        PCI_PRODUCT_QLOGIC_ISP6322      0x6322
+#endif
+
+
 #define        PCI_QLOGIC_ISP1020      \
        ((PCI_PRODUCT_QLOGIC_ISP1020 << 16) | PCI_VENDOR_QLOGIC)
 
@@ -280,6 +289,9 @@
 #define        PCI_QLOGIC_ISP6312      \
        ((PCI_PRODUCT_QLOGIC_ISP6312 << 16) | PCI_VENDOR_QLOGIC)
 
+#define        PCI_QLOGIC_ISP6322      \
+       ((PCI_PRODUCT_QLOGIC_ISP6322 << 16) | PCI_VENDOR_QLOGIC)
+
 /*
  * Odd case for some AMI raid cards... We need to *not* attach to this.
  */
@@ -306,7 +318,6 @@
        bus_dma_tag_t                   dmat;
        bus_dmamap_t                    *dmaps;
 };
-extern ispfwfunc *isp_get_firmware_p;
 
 static device_method_t isp_pci_methods[] = {
        /* Device interface */
@@ -321,6 +332,13 @@
 };
 static devclass_t isp_devclass;
 DRIVER_MODULE(isp, pci, isp_pci_driver, isp_devclass, 0, 0);
+#if __FreeBSD_version >= 700000  
+MODULE_DEPEND(isp, ispfw, 1, 1, 1);
+MODULE_DEPEND(isp, firmware, 1, 1, 1);
+#else
+typedef void ispfwfunc(int, int, int, uint16_t **);
+extern ispfwfunc *isp_get_firmware_p;
+#endif
 
 static int
 isp_pci_probe(device_t dev)
@@ -368,6 +386,9 @@
        case PCI_QLOGIC_ISP6312:
                device_set_desc(dev, "Qlogic ISP 6312 PCI FC-AL Adapter");
                break;
+       case PCI_QLOGIC_ISP6322:
+               device_set_desc(dev, "Qlogic ISP 6322 PCI FC-AL Adapter");
+               break;
        default:
                return (ENXIO);
        }
@@ -848,7 +869,8 @@
                pcs->pci_poff[MBOX_BLOCK >> _BLK_REG_SHFT] =
                    PCI_MBOX_REGS2300_OFF;
        }
-       if (pci_get_devid(dev) == PCI_QLOGIC_ISP2322) {
+       if (pci_get_devid(dev) == PCI_QLOGIC_ISP2322 ||
+           pci_get_devid(dev) == PCI_QLOGIC_ISP6322) {
                mdvp = &mdvec_2300;
                basetype = ISP_HA_FC_2322;
                psize = sizeof (fcparam);
@@ -873,10 +895,58 @@
        isp->isp_revision = pci_get_revid(dev);
        isp->isp_dev = dev;
 
+#if __FreeBSD_version >= 700000  
        /*
         * Try and find firmware for this device.
         */
+       {
+               char fwname[32];
+               unsigned int did = pci_get_device(dev);
 
+               /*
+                * Map a few pci ids to fw names
+                */
+               switch (did) {
+               case PCI_PRODUCT_QLOGIC_ISP1020:
+                       did = 0x1040;
+                       break;
+               case PCI_PRODUCT_QLOGIC_ISP1240:
+                       did = 0x1080;
+                       break;
+               case PCI_PRODUCT_QLOGIC_ISP10160:
+               case PCI_PRODUCT_QLOGIC_ISP12160:
+                       did = 0x12160;
+                       break;
+               case PCI_PRODUCT_QLOGIC_ISP6312:
+               case PCI_PRODUCT_QLOGIC_ISP2312:
+                       did = 0x2300;
+                       break;
+               case PCI_PRODUCT_QLOGIC_ISP6322:
+                       did = 0x2322;
+                       break;
+               default:
+                       break;
+               }
+
+               isp->isp_osinfo.fw = NULL;
+               if (isp->isp_role & ISP_ROLE_TARGET) {
+                       snprintf(fwname, sizeof (fwname), "isp_%04x_it", did);
+                       isp->isp_osinfo.fw = firmware_get(fwname);
+               }
+               if (isp->isp_osinfo.fw == NULL) {
+                       snprintf(fwname, sizeof (fwname), "isp_%04x", did);
+                       isp->isp_osinfo.fw = firmware_get(fwname);
+               }
+               if (isp->isp_osinfo.fw != NULL) {
+                       union {
+                               const void *fred;
+                               uint16_t *bob;
+                       } u;
+                       u.fred = isp->isp_osinfo.fw->data;
+                       isp->isp_mdvec->dv_ispfw = u.bob;
+               }
+       }
+#else
        if (isp_get_firmware_p) {
                int device = (int) pci_get_device(dev);
 #ifdef ISP_TARGET_MODE
@@ -885,6 +955,7 @@
                (*isp_get_firmware_p)(0, 0, device, &mdvp->dv_ispfw);
 #endif
        }
+#endif
 
        /*
         * Make sure that SERR, PERR, WRITE INVALIDATE and BUSMASTER
@@ -892,9 +963,11 @@
         */
        cmd |= PCIM_CMD_SEREN | PCIM_CMD_PERRESPEN |
                PCIM_CMD_BUSMASTEREN | PCIM_CMD_INVEN;
+
        if (IS_2300(isp)) {     /* per QLogic errata */
                cmd &= ~PCIM_CMD_INVEN;
        }
+
        if (IS_23XX(isp)) {
                /*
                 * Can't tell if ROM will hang on 'ABOUT FIRMWARE' command.

==== //depot/projects/smpng/sys/dev/isp/isp_sbus.c#14 (text+ko) ====

@@ -28,10 +28,14 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/isp/isp_sbus.c,v 1.19 2006/04/21 18:30:01 
mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/isp/isp_sbus.c,v 1.20 2006/07/09 17:50:17 
mjacob Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
+#if __FreeBSD_version >= 700000
+#include <sys/linker.h>
+#include <sys/firmware.h>
+#endif
 #include <sys/bus.h>
 #include <sys/kernel.h>
 #include <sys/module.h>
@@ -92,7 +96,6 @@
        struct resource *               sbus_ires;
 };
 
-extern ispfwfunc *isp_get_firmware_p;
 
 static device_method_t isp_sbus_methods[] = {
        /* Device interface */
@@ -107,6 +110,12 @@
 };
 static devclass_t isp_devclass;
 DRIVER_MODULE(isp, sbus, isp_sbus_driver, isp_devclass, 0, 0);
+#if __FreeBSD_version >= 700000
+MODULE_DEPEND(isp, firmware, 1, 1, 1);
+#else
+typedef void ispfwfunc(int, int, int, uint16_t **);
+extern ispfwfunc *isp_get_firmware_p;
+#endif
 
 static int
 isp_sbus_probe(device_t dev)
@@ -249,13 +258,24 @@
        isp->isp_confopts |= ISP_CFG_NONVRAM;
 
 
+#if __FreeBSD_version >= 700000
+       isp->isp_osinfo.fw = firmware_get("isp_1000");
+       if (isp->isp_osinfo.fw) {
+               union {
+                       const void *cp;
+                       uint16_t *sp;
+               } stupid;
+               stupid.cp = isp->isp_osinfo.fw->data;
+               isp->isp_mdvec->dv_ispfw = stupid.sp;
+       }
+#else
        /*
         * Try and find firmware for this device.
         */
-
        if (isp_get_firmware_p) {
                (*isp_get_firmware_p)(0, 0, 0x1000, &sbs->sbus_mdvec.dv_ispfw);
        }
+#endif
 
        iqd = 0;
        sbs->sbus_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &iqd,

==== //depot/projects/smpng/sys/dev/ispfw/asm_1040.h#3 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/dev/ispfw/asm_1040.h,v 1.4 2005/01/06 01:42:49 imp Exp $ 
*/
+/* $FreeBSD: src/sys/dev/ispfw/asm_1040.h,v 1.5 2006/07/09 17:50:17 mjacob Exp 
$ */
 /*-
  * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Qlogic, Inc.
  * All rights reserved.
@@ -34,6 +34,7 @@
 /*
  *     Firmware Version 4.66.00 (14:49 Sep 05, 2000)
  */
+#ifdef ISP_1040
 static const u_int16_t isp_1040_risc_code[] = {
        0x0078, 0x1041, 0x0000, 0x2cd0, 0x0000, 0x2043, 0x4f50, 0x5952,
        0x4947, 0x4854, 0x2031, 0x3939, 0x312c, 0x3139, 0x3932, 0x2c31,
@@ -1470,6 +1471,7 @@
        0x0040, 0x3cc6, 0x20a9, 0x0100, 0x0078, 0x3caf, 0x2009, 0x3d51,
        0x200b, 0x3d7f, 0x2009, 0x3d50, 0x200b, 0x0000, 0x007c, 0x4de2
 };
+#endif
 /************************************************************************
  *                                                                     *
  *             --- ISP1040 Initiator/Target Firmware ---               *
@@ -1479,7 +1481,8 @@
 /*
  *     Firmware Version 7.65.00 (14:17 Jul 20, 1999)
  */
-static const u_int16_t isp_1040_risc_code_it[] = {
+#ifdef ISP_1040_IT
+static const u_int16_t isp_1040_it_risc_code[] = {
        0x0078, 0x103a, 0x0000, 0x4057, 0x0000, 0x2043, 0x4f50, 0x5952,
        0x4947, 0x4854, 0x2031, 0x3939, 0x3520, 0x514c, 0x4f47, 0x4943,
        0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350,
@@ -3540,3 +3543,4 @@
        0x0014, 0x878e, 0x0016, 0xa21c, 0x1035, 0xa8af, 0xa210, 0x3807,
        0x300c, 0x817e, 0x872b, 0x8772, 0xa8a8, 0x0000, 0xdf21
 };
+#endif

==== //depot/projects/smpng/sys/dev/ispfw/asm_1080.h#3 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/dev/ispfw/asm_1080.h,v 1.3 2005/01/06 01:42:49 imp Exp $ 
*/
+/* $FreeBSD: src/sys/dev/ispfw/asm_1080.h,v 1.4 2006/07/09 17:50:17 mjacob Exp 
$ */
 /*-
  * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Qlogic, Inc.
  * All rights reserved.
@@ -34,6 +34,7 @@
 /*
  *     Firmware Version 8.15.00 (14:35 Aug 22, 2000)
  */
+#ifdef ISP_1080
 static const u_int16_t isp_1080_risc_code[] = {
        0x0078, 0x1041, 0x0000, 0x3d3b, 0x0000, 0x2043, 0x4f50, 0x5952,
        0x4947, 0x4854, 0x2031, 0x3939, 0x312c, 0x3139, 0x3932, 0x2c31,
@@ -1996,6 +1997,7 @@
        0x4cee, 0x7804, 0xd08c, 0x0040, 0x4d37, 0x681f, 0x000c, 0x70a0,
        0x70a2, 0x007c, 0x205b
 };
+#endif
 /************************************************************************
  *                                                                     *
  *      --- ISP1240/ISP1080/ISP1280 Initiator/Target Firmware ---      *
@@ -2005,8 +2007,8 @@
 /*
  *     Firmware Version 9.11.01 (15:46 May 23, 2000)
  */
-
-static const u_int16_t isp_1080_risc_code_it[] = {
+#ifdef ISP_1080_IT
+static const u_int16_t isp_1080_it_risc_code[] = {
        0x0078, 0x103a, 0x0000, 0x4f62, 0x0000, 0x2043, 0x4f50, 0x5952,
        0x4947, 0x4854, 0x2031, 0x3939, 0x3520, 0x514c, 0x4f47, 0x4943,
        0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350,
@@ -4549,3 +4551,4 @@
        0xa8bb, 0xa210, 0x3807, 0x300c, 0x817e, 0x872b, 0x8772, 0x0014,
        0x0000, 0xd27a
 };
+#endif

==== //depot/projects/smpng/sys/dev/ispfw/asm_12160.h#5 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/dev/ispfw/asm_12160.h,v 1.6 2005/01/06 01:42:50 imp Exp $ 
*/
+/* $FreeBSD: src/sys/dev/ispfw/asm_12160.h,v 1.7 2006/07/09 17:50:17 mjacob 
Exp $ */
 /*-
  * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Qlogic, Inc.
  * All rights reserved.
@@ -34,6 +34,7 @@
 /*
  *     Firmware Version 10.04.41 (10:30 Mar 21, 2003)
  */
+#ifdef ISP_12160
 static const u_int16_t isp_12160_risc_code[] = {
        0x0804, 0x1041, 0x0000, 0x36c9, 0x0000, 0x2043, 0x4f50, 0x5952,
        0x4947, 0x4854, 0x2031, 0x3939, 0x312c, 0x3139, 0x3932, 0x2c31,
@@ -1790,10 +1791,12 @@
        0x0018, 0x00ce, 0x681f, 0x000c, 0x001e, 0x70a0, 0x70a2, 0x0005,
        0x0c28
 };
+#endif
 /*
  *     Firmware Version 11.12.19 (17:10 Oct 25, 2001)
  */
-static const u_int16_t isp_12160_risc_code_it[] = {
+#ifdef ISP_12160_IT
+static const u_int16_t isp_12160_it_risc_code[] = {
        0x0804, 0x103a, 0x0000, 0x4f4e, 0x0000, 0x2043, 0x4f50, 0x5952,
        0x4947, 0x4854, 0x2031, 0x3939, 0x3520, 0x514c, 0x4f47, 0x4943,
        0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350,
@@ -4333,3 +4336,4 @@
        0x9521, 0x85a1, 0x806f, 0x9422, 0x84a2, 0x80fd, 0x9405, 0x8485,
        0x7021, 0x0014, 0xa300, 0xa8ca, 0x0000, 0x7a3c
 };
+#endif

==== //depot/projects/smpng/sys/dev/ispfw/ispfw.c#13 (text+ko) ====

@@ -1,7 +1,7 @@
 /*-
- * ISP Firmware Helper Pseudo Device for FreeBSD
+ * ISP Firmware Modules for FreeBSD
  *
- * Copyright (c) 2000, 2001, by Matthew Jacob
+ * Copyright (c) 2000, 2001, 2006 by Matthew Jacob
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -27,158 +27,183 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ispfw/ispfw.c,v 1.16 2006/07/03 08:22:09 
mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ispfw/ispfw.c,v 1.17 2006/07/09 17:50:18 
mjacob Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
-#include <sys/malloc.h>
 #include <sys/module.h>
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/linker.h>
+#include <sys/firmware.h>
 
+#if    defined(ISP_ALL) || !defined(KLD_MODULE) 
+#define        ISP_1040        1
+#define        ISP_1040_IT     1
+#define        ISP_1080        1
+#define        ISP_1080_IT     1
+#define        ISP_12160       1
+#define        ISP_12160_IT    1
+#define        ISP_2100        1
+#define        ISP_2200        1
+#define        ISP_2300        1
+#define        ISP_2322        1
+#ifdef __sparc64__
+#define        ISP_1000        1
+#endif
+#define        MODULE_NAME     "isp"
+#endif
+
+#if    defined(ISP_1040) || defined(ISP_1040_IT)
 #include <dev/ispfw/asm_1040.h>
+#endif
+#if    defined(ISP_1080) || defined(ISP_1080_IT)
 #include <dev/ispfw/asm_1080.h>
+#endif
+#if    defined(ISP_12160) || defined(ISP_12160_IT)
 #include <dev/ispfw/asm_12160.h>
+#endif
+#if    defined(ISP_2100)
 #include <dev/ispfw/asm_2100.h>
+#endif
+#if    defined(ISP_2200)
 #include <dev/ispfw/asm_2200.h>
+#endif
+#if    defined(ISP_2300)
 #include <dev/ispfw/asm_2300.h>
+#endif
+#if    defined(ISP_2322)
 #include <dev/ispfw/asm_2322.h>
-#ifdef __sparc64__
+#endif
+#if    defined(ISP_1000)
 #include <dev/ispfw/asm_1000.h>
 #endif
 
-#define        ISPFW_VERSION   0
+#define        ISPFW_VERSION   1
+#define        RMACRO(token)                                                   
\
+       if (firmware_register(#token, token##_risc_code,                \
+           token##_risc_code [3] << 1, ISPFW_VERSION, NULL) == NULL) { \
+               printf("unable to register firmware '%s'\n", #token);   \
+       } else {                                                        \
+               printf("registered firmware set <%s>\n", #token);       \
+       }
 
-#define        PCI_PRODUCT_QLOGIC_ISP1020      0x1020
-#define        PCI_PRODUCT_QLOGIC_ISP1080      0x1080
-#define        PCI_PRODUCT_QLOGIC_ISP10160     0x1016
-#define        PCI_PRODUCT_QLOGIC_ISP12160     0x1216
-#define        PCI_PRODUCT_QLOGIC_ISP1240      0x1240
-#define        PCI_PRODUCT_QLOGIC_ISP1280      0x1280
-#define        PCI_PRODUCT_QLOGIC_ISP2100      0x2100
-#define        PCI_PRODUCT_QLOGIC_ISP2200      0x2200
-#define        PCI_PRODUCT_QLOGIC_ISP2300      0x2300
-#define        PCI_PRODUCT_QLOGIC_ISP2312      0x2312
-#define        PCI_PRODUCT_QLOGIC_ISP2322      0x2322
-#define        PCI_PRODUCT_QLOGIC_ISP6312      0x6312
-#ifdef __sparc64__
-#define        SBUS_PRODUCT_QLOGIC_ISP1000     0x1000
-#endif
-
-typedef void ispfwfunc(int, int, int, const u_int16_t **);
-extern ispfwfunc *isp_get_firmware_p;
-static void isp_get_firmware(int, int, int, const u_int16_t **);
+#define        UMACRO(token)                                                   
\
+       firmware_unregister(#token);                                    \
+       printf("unregistered firmware set <%s>\n", #token);
 
-static int ncallers = 0;
-static const u_int16_t ***callp = NULL;
-static int addcaller(const u_int16_t **);
-
 static int
-addcaller(const u_int16_t **caller)
+do_load_fw(void)
 {
-       const u_int16_t ***newcallp;
-       int i;
-       for (i = 0; i < ncallers; i++) {
-               if (callp[i] == caller)
-                       return (1);
-       }
-       newcallp = malloc((ncallers + 1) * sizeof (const u_int16_t ***),
-           M_DEVBUF, M_NOWAIT);
-       if (newcallp == NULL) {
-               return (0);
-       }
-       for (i = 0; i < ncallers; i++) {
-               newcallp[i] = callp[i];
-       }
-       newcallp[ncallers] = caller;
-       if (ncallers++)
-               free(callp, M_DEVBUF);
-       callp = newcallp;
-       return (1);
+#if    defined(ISP_1000)
+       RMACRO(isp_1000);
+#endif
+#if    defined(ISP_1040)
+       RMACRO(isp_1040);
+#endif
+#if    defined(ISP_1040_IT)
+       RMACRO(isp_1040_it);
+#endif
+#if    defined(ISP_1080)
+       RMACRO(isp_1080);
+#endif
+#if    defined(ISP_1080_IT)
+       RMACRO(isp_1080_it);
+#endif
+#if    defined(ISP_12160)
+       RMACRO(isp_12160);
+#endif
+#if    defined(ISP_12160_IT)
+       RMACRO(isp_12160_it);
+#endif
+#if    defined(ISP_2100)
+       RMACRO(isp_2100);
+#endif
+#if    defined(ISP_2200)
+       RMACRO(isp_2200);
+#endif
+#if    defined(ISP_2300)
+       RMACRO(isp_2300);
+#endif
+#if    defined(ISP_2322)
+       RMACRO(isp_2322);
+#endif
+       return (0);
 }
 
-static void
-isp_get_firmware(int version, int tgtmode, int devid, const u_int16_t **ptrp)
+static int
+do_unload_fw(void)
 {
-       const u_int16_t *rp = NULL;
-
-       if (version == ISPFW_VERSION) {
-               switch (devid) {
-               case PCI_PRODUCT_QLOGIC_ISP1020:
-                       if (tgtmode)
-                               rp = isp_1040_risc_code_it;
-                       else
-                               rp = isp_1040_risc_code;
-                       break;
-               case PCI_PRODUCT_QLOGIC_ISP1080:
-               case PCI_PRODUCT_QLOGIC_ISP1240:
-               case PCI_PRODUCT_QLOGIC_ISP1280:
-                       if (tgtmode)
-                               rp = isp_1080_risc_code_it;
-                       else
-                               rp = isp_1080_risc_code;
-                       break;
-               case PCI_PRODUCT_QLOGIC_ISP10160:
-               case PCI_PRODUCT_QLOGIC_ISP12160:
-                       if (tgtmode)
-                               rp = isp_12160_risc_code_it;
-                       else
-                               rp = isp_12160_risc_code;
-                       break;
-               case PCI_PRODUCT_QLOGIC_ISP2100:
-                       rp = isp_2100_risc_code;
-                       break;
-               case PCI_PRODUCT_QLOGIC_ISP2200:
-                       rp = isp_2200_risc_code;
-                       break;
-               case PCI_PRODUCT_QLOGIC_ISP2300:
-               case PCI_PRODUCT_QLOGIC_ISP2312:
-               case PCI_PRODUCT_QLOGIC_ISP6312:
-                       rp = isp_2300_risc_code;
-                       break;
-               case PCI_PRODUCT_QLOGIC_ISP2322:
-                       rp = isp_2322_risc_code;
-                       break;
-#ifdef __sparc64__
-               case SBUS_PRODUCT_QLOGIC_ISP1000:
-                       if (tgtmode)
-                               break;
-                       rp = isp_1000_risc_code;
-                       break;
+#if    defined(ISP_1000)
+       UMACRO(isp_1000);
+#elif  defined(ISP_1040)
+       UMACRO(isp_1040);
+#elif  defined(ISP_1040_IT)
+       UMACRO(isp_1040_it);
+#elif  defined(ISP_1080)
+       UMACRO(isp_1080);
+#elif  defined(ISP_1080_IT)
+       UMACRO(isp_1080_it);
+#elif  defined(ISP_12160)
+       UMACRO(isp_12160);
+#elif  defined(ISP_12160_IT)
+       UMACRO(isp_12160_it);
+#elif  defined(ISP_2100)
+       UMACRO(isp_2100);
+#elif  defined(ISP_2200)
+       UMACRO(isp_2200);
+#elif  defined(ISP_2300)
+       UMACRO(isp_2300);
+#elif  defined(ISP_2322)
+       UMACRO(isp_2322);
 #endif
-               default:
-                       break;
-               }
-       }
-       if (rp && addcaller(ptrp)) {
-               *ptrp = rp;
-       }
+       return (0);
 }
 
 static int
-isp_module_handler(module_t mod, int what, void *arg)
+module_handler(module_t mod, int what, void *arg)
 {
+       int r;
        switch (what) {
        case MOD_LOAD:
-               isp_get_firmware_p = isp_get_firmware;
+               r = do_load_fw();
                break;
        case MOD_UNLOAD:
-               isp_get_firmware_p = NULL;
-               if (ncallers)  {
-                       int i;
-                       for (i = 0; i < ncallers; i++) {
-                               *callp[i] = NULL;
-                       }
-                       free(callp, M_DEVBUF);
-               }
+               r = do_unload_fw();
                break;
        default:
-               return (EOPNOTSUPP);
+               r = EOPNOTSUPP;
                break;
        }
-       return (0);
+       return (r);
 }
 static moduledata_t ispfw_mod = {
-       "ispfw", isp_module_handler, NULL
+       MODULE_NAME, module_handler, NULL
 };
-DECLARE_MODULE(ispfw, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
-MODULE_VERSION(ispfw, ISPFW_VERSION);
-MODULE_DEPEND(ispfw, isp, 1, 1, 1);
+#ifndef        KLD_MODULE
+DECLARE_MODULE(isp, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
+#else
+#if    defined(ISP_1000)
+DECLARE_MODULE(isp_1000, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
+#elif  defined(ISP_1040)
+DECLARE_MODULE(isp_1040, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
+#elif  defined(ISP_1040_IT)
+DECLARE_MODULE(isp_1040_it, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
+#elif  defined(ISP_1080)
+DECLARE_MODULE(isp_1080, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
+#elif  defined(ISP_1080_IT)
+DECLARE_MODULE(isp_1080_it, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
+#elif  defined(ISP_12160)
+DECLARE_MODULE(isp_12160, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
+#elif  defined(ISP_12160_IT)
+DECLARE_MODULE(isp_12160_IT, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
+#elif  defined(ISP_2100)
+DECLARE_MODULE(isp_2100, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
+#elif  defined(ISP_2200)
+DECLARE_MODULE(isp_2200, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
+#elif  defined(ISP_2300)
+DECLARE_MODULE(isp_2300, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
+#elif  defined(ISP_2322)
+DECLARE_MODULE(isp_2322, ispfw_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD);
+#endif
+#endif

==== //depot/projects/smpng/sys/geom/raid3/g_raid3.c#31 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/raid3/g_raid3.c,v 1.67 2006/07/03 10:32:38 
pjd Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/raid3/g_raid3.c,v 1.68 2006/07/09 12:25:56 
pjd Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -71,6 +71,10 @@
 TUNABLE_INT("kern.geom.raid3.sync_requests", &g_raid3_syncreqs);
 SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, sync_requests, CTLFLAG_RDTUN,
     &g_raid3_syncreqs, 0, "Parallel synchronization I/O requests.");
+static u_int g_raid3_use_malloc = 0;
+TUNABLE_INT("kern.geom.raid3.use_malloc", &g_raid3_use_malloc);
+SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, use_malloc, CTLFLAG_RDTUN,
+    &g_raid3_use_malloc, 0, "Use malloc(9) instead of uma(9).");
 
 static u_int g_raid3_n64k = 50;
 TUNABLE_INT("kern.geom.raid3.n64k", &g_raid3_n64k);
@@ -175,6 +179,35 @@
        return (disk->d_name);
 }
 
+static void *
+g_raid3_alloc(struct g_raid3_softc *sc, size_t size, int flags)
+{
+       void *ptr;
+
+       if (g_raid3_use_malloc)
+               ptr = malloc(size, M_RAID3, flags);
+       else {
+               ptr = uma_zalloc_arg(sc->sc_zones[g_raid3_zone(size)].sz_zone,
+                  &sc->sc_zones[g_raid3_zone(size)], flags);
+               sc->sc_zones[g_raid3_zone(size)].sz_requested++;
+               if (ptr == NULL)
+                       sc->sc_zones[g_raid3_zone(size)].sz_failed++;
+       }
+       return (ptr);
+}
+
+static void
+g_raid3_free(struct g_raid3_softc *sc, void *ptr, size_t size)
+{
+
+       if (g_raid3_use_malloc)
+               free(ptr, M_RAID3);
+       else {
+               uma_zfree_arg(sc->sc_zones[g_raid3_zone(size)].sz_zone,
+                   ptr, &sc->sc_zones[g_raid3_zone(size)]);
+       }
+}
+
 static int
 g_raid3_uma_ctor(void *mem, int size, void *arg, int flags)
 {
@@ -610,9 +643,11 @@
        G_RAID3_DEBUG(0, "Device %s destroyed.", gp->name);
        g_wither_geom(gp, ENXIO);
        g_topology_unlock();
-       uma_zdestroy(sc->sc_zones[G_RAID3_ZONE_64K].sz_zone);
-       uma_zdestroy(sc->sc_zones[G_RAID3_ZONE_16K].sz_zone);
-       uma_zdestroy(sc->sc_zones[G_RAID3_ZONE_4K].sz_zone);
+       if (!g_raid3_use_malloc) {
+               uma_zdestroy(sc->sc_zones[G_RAID3_ZONE_64K].sz_zone);
+               uma_zdestroy(sc->sc_zones[G_RAID3_ZONE_16K].sz_zone);
+               uma_zdestroy(sc->sc_zones[G_RAID3_ZONE_4K].sz_zone);
+       }
        mtx_destroy(&sc->sc_queue_mtx);
        mtx_destroy(&sc->sc_events_mtx);
        sx_xunlock(&sc->sc_lock);
@@ -944,9 +979,7 @@
        pbp->bio_children--;
        KASSERT(cbp->bio_data != NULL, ("NULL bio_data"));
        size = pbp->bio_length / (sc->sc_ndisks - 1);
-       uma_zfree_arg(sc->sc_zones[g_raid3_zone(size)].sz_zone,
-           cbp->bio_data,
-           &sc->sc_zones[g_raid3_zone(size)]);
+       g_raid3_free(sc, cbp->bio_data, size);
        if (G_RAID3_HEAD_BIO(pbp) == cbp) {
                G_RAID3_HEAD_BIO(pbp) = G_RAID3_NEXT_BIO(cbp);
                G_RAID3_NEXT_BIO(cbp) = NULL;
@@ -981,11 +1014,8 @@
                memflag = M_WAITOK;
        else
                memflag = M_NOWAIT;
-       cbp->bio_data = uma_zalloc_arg(sc->sc_zones[g_raid3_zone(size)].sz_zone,
-          &sc->sc_zones[g_raid3_zone(size)], memflag);
-       sc->sc_zones[g_raid3_zone(size)].sz_requested++;
+       cbp->bio_data = g_raid3_alloc(sc, size, memflag);
        if (cbp->bio_data == NULL) {
-               sc->sc_zones[g_raid3_zone(size)].sz_failed++;
                pbp->bio_children--;
                g_destroy_bio(cbp);
                return (NULL);
@@ -3046,33 +3076,40 @@
        gp->orphan = g_raid3_orphan;
        sc->sc_sync.ds_geom = gp;
 
-       sc->sc_zones[G_RAID3_ZONE_64K].sz_zone = uma_zcreate("gr3:64k", 65536,
-           g_raid3_uma_ctor, g_raid3_uma_dtor, NULL, NULL, UMA_ALIGN_PTR, 0);
-       sc->sc_zones[G_RAID3_ZONE_64K].sz_inuse = 0;
-       sc->sc_zones[G_RAID3_ZONE_64K].sz_max = g_raid3_n64k;
-       sc->sc_zones[G_RAID3_ZONE_64K].sz_requested =
-           sc->sc_zones[G_RAID3_ZONE_64K].sz_failed = 0;
-       sc->sc_zones[G_RAID3_ZONE_16K].sz_zone = uma_zcreate("gr3:16k", 16384,
-           g_raid3_uma_ctor, g_raid3_uma_dtor, NULL, NULL, UMA_ALIGN_PTR, 0);
-       sc->sc_zones[G_RAID3_ZONE_16K].sz_inuse = 0;
-       sc->sc_zones[G_RAID3_ZONE_16K].sz_max = g_raid3_n16k;
-       sc->sc_zones[G_RAID3_ZONE_16K].sz_requested =
-           sc->sc_zones[G_RAID3_ZONE_16K].sz_failed = 0;
-       sc->sc_zones[G_RAID3_ZONE_4K].sz_zone = uma_zcreate("gr3:4k", 4096,
-           g_raid3_uma_ctor, g_raid3_uma_dtor, NULL, NULL, UMA_ALIGN_PTR, 0);
-       sc->sc_zones[G_RAID3_ZONE_4K].sz_inuse = 0;
-       sc->sc_zones[G_RAID3_ZONE_4K].sz_max = g_raid3_n4k;

>>> TRUNCATED FOR MAIL (1000 lines) <<<
_______________________________________________
p4-projects@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/p4-projects
To unsubscribe, send any mail to "p4-projects-unsubscribe@xxxxxxxxxxx"

<Prev in Thread] Current Thread [Next in Thread>
  • PERFORCE change 101214 for review, John Baldwin <=