Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Bye-bye fw_port.h.



details:   https://anonhg.NetBSD.org/src/rev/8a3c962ec8a1
branches:  trunk
changeset: 753444:8a3c962ec8a1
user:      kiyohara <kiyohara%NetBSD.org@localhost>
date:      Mon Mar 29 03:05:27 2010 +0000

description:
Bye-bye fw_port.h.

diffstat:

 sys/dev/cardbus/fwohci_cardbus.c |    11 +-
 sys/dev/ieee1394/firewire.c      |  3056 ++++++++++++++++-----------------
 sys/dev/ieee1394/firewire.h      |   105 +-
 sys/dev/ieee1394/firewire_phy.h  |     8 +-
 sys/dev/ieee1394/firewirereg.h   |   103 +-
 sys/dev/ieee1394/fw_port.h       |   809 --------
 sys/dev/ieee1394/fwcrom.c        |   163 +-
 sys/dev/ieee1394/fwdev.c         |   838 +++-----
 sys/dev/ieee1394/fwdma.c         |   214 +-
 sys/dev/ieee1394/fwdma.h         |    69 +-
 sys/dev/ieee1394/fwmem.c         |   691 +++----
 sys/dev/ieee1394/fwmem.h         |    47 +-
 sys/dev/ieee1394/fwohci.c        |  3435 ++++++++++++++++++-------------------
 sys/dev/ieee1394/fwohcireg.h     |    93 +-
 sys/dev/ieee1394/fwohcivar.h     |    55 +-
 sys/dev/ieee1394/fwphyreg.h      |    27 +-
 sys/dev/ieee1394/iec13213.h      |    17 +-
 sys/dev/ieee1394/iec68113.h      |     9 +-
 sys/dev/ieee1394/if_fwip.c       |   840 +++-----
 sys/dev/ieee1394/if_fwipvar.h    |    52 +-
 sys/dev/ieee1394/sbp.c           |  2554 ++++++++++-----------------
 sys/dev/ieee1394/sbp.h           |    12 +-
 sys/dev/pci/fwohci_pci.c         |    26 +-
 sys/net/if_ieee1394subr.c        |    19 +-
 24 files changed, 5577 insertions(+), 7676 deletions(-)

diffs (truncated from 18304 to 300 lines):

diff -r 353cf517b817 -r 8a3c962ec8a1 sys/dev/cardbus/fwohci_cardbus.c
--- a/sys/dev/cardbus/fwohci_cardbus.c  Mon Mar 29 02:48:17 2010 +0000
+++ b/sys/dev/cardbus/fwohci_cardbus.c  Mon Mar 29 03:05:27 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fwohci_cardbus.c,v 1.31 2010/03/05 00:36:06 dyoung Exp $       */
+/*     $NetBSD: fwohci_cardbus.c,v 1.32 2010/03/29 03:05:27 kiyohara Exp $     */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fwohci_cardbus.c,v 1.31 2010/03/05 00:36:06 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwohci_cardbus.c,v 1.32 2010/03/29 03:05:27 kiyohara Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -47,7 +47,6 @@
 #include <dev/cardbus/cardbusvar.h>
 #include <dev/pci/pcidevs.h>
 
-#include <dev/ieee1394/fw_port.h>
 #include <dev/ieee1394/firewire.h>
 #include <dev/ieee1394/firewirereg.h>
 #include <dev/ieee1394/fwdma.h>
@@ -116,7 +115,7 @@
        sc->sc_ct = ct;
 
        /* Disable interrupts, so we don't get any spurious ones. */
-       OHCI_CSR_WRITE(&sc->sc_sc, FWOHCI_INTMASKCLR, OHCI_INT_EN);
+       OWRITE(&sc->sc_sc, FWOHCI_INTMASKCLR, OHCI_INT_EN);
 
        /* Enable the device. */
        csr = Cardbus_conf_read(ct, ca->ca_tag, PCI_COMMAND_STATUS_REG);
@@ -124,14 +123,14 @@
            csr | PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_MEM_ENABLE);
 
        sc->sc_ih = Cardbus_intr_establish(ct, ca->ca_intrline,
-                                          IPL_BIO, fwohci_filt, sc);
+                                          IPL_BIO, fwohci_intr, sc);
        if (sc->sc_ih == NULL) {
                aprint_error_dev(self, "couldn't establish interrupt\n");
                return;
        }
 
        /* XXX NULL should be replaced by some call to Cardbus coed */
-       if (fwohci_init(&sc->sc_sc, sc->sc_sc.fc.dev) != 0) {
+       if (fwohci_init(&sc->sc_sc) != 0) {
                Cardbus_intr_disestablish(ct, sc->sc_ih);
                sc->sc_ih = NULL;
        }
diff -r 353cf517b817 -r 8a3c962ec8a1 sys/dev/ieee1394/firewire.c
--- a/sys/dev/ieee1394/firewire.c       Mon Mar 29 02:48:17 2010 +0000
+++ b/sys/dev/ieee1394/firewire.c       Mon Mar 29 03:05:27 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: firewire.c,v 1.26 2010/03/11 04:00:36 mrg Exp $        */
+/*     $NetBSD: firewire.c,v 1.27 2010/03/29 03:05:27 kiyohara Exp $   */
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -31,55 +31,21 @@
  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
- * 
- * $FreeBSD: src/sys/dev/firewire/firewire.c,v 1.101 2007/10/20 23:23:14 julian Exp $
+ *
+ * $FreeBSD: src/sys/dev/firewire/firewire.c,v 1.110 2009/04/07 02:33:46 sbruno Exp $
  *
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: firewire.c,v 1.26 2010/03/11 04:00:36 mrg Exp $");
-
-#if defined(__FreeBSD__)
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/types.h>
-
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/malloc.h>
-#include <sys/conf.h>
-#include <sys/sysctl.h>
-#include <sys/kthread.h>
-
-#include <sys/kdb.h>
-
-#if defined(__DragonFly__) || __FreeBSD_version < 500000
-#include <machine/clock.h>     /* for DELAY() */
-#endif
+__KERNEL_RCSID(0, "$NetBSD: firewire.c,v 1.27 2010/03/29 03:05:27 kiyohara Exp $");
 
-#include <sys/bus.h>           /* used by smbus and newbus */
+#include <sys/param.h>
 #include <sys/bus.h>
-
-#ifdef __DragonFly__
-#include "fw_port.h"
-#include "firewire.h"
-#include "firewirereg.h"
-#include "fwmem.h"
-#include "iec13213.h"
-#include "iec68113.h"
-#else
-#include <dev/firewire/fw_port.h>
-#include <dev/firewire/firewire.h>
-#include <dev/firewire/firewirereg.h>
-#include <dev/firewire/fwmem.h>
-#include <dev/firewire/iec13213.h>
-#include <dev/firewire/iec68113.h>
-#endif
-#elif defined(__NetBSD__)
-#include <sys/param.h>
+#include <sys/callout.h>
+#include <sys/condvar.h>
+#include <sys/conf.h>
 #include <sys/device.h>
 #include <sys/errno.h>
-#include <sys/conf.h>
 #include <sys/kernel.h>
 #include <sys/kthread.h>
 #include <sys/malloc.h>
@@ -87,9 +53,6 @@
 #include <sys/sysctl.h>
 #include <sys/systm.h>
 
-#include <sys/bus.h>
-
-#include <dev/ieee1394/fw_port.h>
 #include <dev/ieee1394/firewire.h>
 #include <dev/ieee1394/firewirereg.h>
 #include <dev/ieee1394/fwmem.h>
@@ -97,7 +60,6 @@
 #include <dev/ieee1394/iec68113.h>
 
 #include "locators.h"
-#endif
 
 struct crom_src_buf {
        struct crom_src src;
@@ -106,19 +68,7 @@
        struct crom_chunk hw;
 };
 
-int firewire_debug=0, try_bmr=1, hold_count=3;
-#if defined(__FreeBSD__)
-SYSCTL_INT(_debug, OID_AUTO, firewire_debug, CTLFLAG_RW, &firewire_debug, 0,
-       "FireWire driver debug flag");
-SYSCTL_NODE(_hw, OID_AUTO, firewire, CTLFLAG_RD, 0, "FireWire Subsystem");
-SYSCTL_INT(_hw_firewire, OID_AUTO, try_bmr, CTLFLAG_RW, &try_bmr, 0,
-       "Try to be a bus manager");
-SYSCTL_INT(_hw_firewire, OID_AUTO, hold_count, CTLFLAG_RW, &hold_count, 0,
-       "Number of count of bus resets for removing lost device information");
-
-MALLOC_DEFINE(M_FW, "firewire", "FireWire");
-MALLOC_DEFINE(M_FWXFER, "fw_xfer", "XFER/FireWire");
-#elif defined(__NetBSD__)
+int firewire_debug = 0, try_bmr = 1, hold_count = 0;
 /*
  * Setup sysctl(3) MIB, hw.ieee1394if.*
  *
@@ -174,69 +124,54 @@
        return;
 
 err:
-       printf("%s: sysctl_createv failed (rc = %d)\n", __func__, rc);
+       aprint_error("%s: sysctl_createv failed (rc = %d)\n", __func__, rc);
 }
 
 MALLOC_DEFINE(M_FW, "ieee1394", "IEEE1394");
 MALLOC_DEFINE(M_FWXFER, "fw_xfer", "XFER/IEEE1394");
-#endif
 
 #define FW_MAXASYRTY 4
 
-#if defined(__FreeBSD__)
-devclass_t firewire_devclass;
+#define FW_GENERATION_CHANGEABLE       2
 
-static void firewire_identify  (driver_t *, device_t);
-static int firewire_probe      (device_t);
-static int firewire_attach      (device_t);
-static int firewire_detach      (device_t);
-static int firewire_resume      (device_t);
-#if 0
-static int firewire_shutdown    (device_t);
-#endif
-static device_t firewire_add_child   (device_t, int, const char *, int);
-#elif defined(__NetBSD__)
-int firewirematch (device_t, cfdata_t, void *);
-void firewireattach (device_t, device_t, void *);
-int firewiredetach (device_t, int);
-int firewire_print (void *, const char *);
+static int firewirematch (device_t, cfdata_t, void *);
+static void firewireattach (device_t, device_t, void *);
+static int firewiredetach (device_t, int);
+static int firewire_print (void *, const char *);
+
 int firewire_resume (struct firewire_comm *);
-#endif
-static void firewire_xfer_timeout(void *, int);
-static void fw_try_bmr (void *);
-static void fw_try_bmr_callback (struct fw_xfer *);
-static void fw_asystart (struct fw_xfer *);
-static int fw_get_tlabel (struct firewire_comm *, struct fw_xfer *);
-static void fw_bus_probe (struct firewire_comm *);
-static void fw_attach_dev (struct firewire_comm *);
-static void fw_bus_probe_thread(void *);
-#ifdef FW_VMACCESS
-static void fw_vmaccess (struct fw_xfer *);
-#endif
-static int fw_bmr (struct firewire_comm *);
-static void fw_dump_hdr(struct fw_pkt *, const char *);
 
-#if defined(__FreeBSD__)
-static device_method_t firewire_methods[] = {
-       /* Device interface */
-       DEVMETHOD(device_identify,      firewire_identify),
-       DEVMETHOD(device_probe,         firewire_probe),
-       DEVMETHOD(device_attach,        firewire_attach),
-       DEVMETHOD(device_detach,        firewire_detach),
-       DEVMETHOD(device_suspend,       bus_generic_suspend),
-       DEVMETHOD(device_resume,        firewire_resume),
-       DEVMETHOD(device_shutdown,      bus_generic_shutdown),
+static void fw_asystart(struct fw_xfer *);
+static void firewire_xfer_timeout(struct firewire_comm *);
+static void firewire_watchdog(void *);
+static void fw_xferq_drain(struct fw_xferq *);
+static void fw_reset_csr(struct firewire_comm *);
+static void fw_init_crom(struct firewire_comm *);
+static void fw_reset_crom(struct firewire_comm *);
+static void fw_dump_hdr(struct fw_pkt *, const char *);
+static void fw_tl_free(struct firewire_comm *, struct fw_xfer *);
+static struct fw_xfer *fw_tl2xfer(struct firewire_comm *, int, int, int);
+static void fw_phy_config(struct firewire_comm *, int, int);
+static void fw_print_sid(uint32_t);
+static void fw_bus_probe(struct firewire_comm *);
+static int fw_explore_read_quads(struct fw_device *, int, uint32_t *, int);
+static int fw_explore_csrblock(struct fw_device *, int, int);
+static int fw_explore_node(struct fw_device *);
+static union fw_self_id *fw_find_self_id(struct firewire_comm *, int);
+static void fw_explore(struct firewire_comm *);
+static void fw_bus_probe_thread(void *);
+static void fw_attach_dev(struct firewire_comm *);
+static int fw_get_tlabel(struct firewire_comm *, struct fw_xfer *);
+static void fw_rcv_copy(struct fw_rcv_buf *);
+static void fw_try_bmr_callback(struct fw_xfer *);
+static void fw_try_bmr(void *);
+static int fw_bmr(struct firewire_comm *);
 
-       /* Bus interface */
-       DEVMETHOD(bus_add_child,        firewire_add_child),
-       DEVMETHOD(bus_print_child,      bus_generic_print_child),
 
-       { 0, 0 }
-};
-#elif defined(__NetBSD__)
 CFATTACH_DECL_NEW(ieee1394if, sizeof(struct firewire_softc),
     firewirematch, firewireattach, firewiredetach, NULL);
-#endif
+
+
 const char *fw_linkspeed[] = {
        "S100", "S200", "S400", "S800",
        "S1600", "S3200", "undef", "undef"
@@ -254,395 +189,142 @@
 u_int gap_cnt[] = { 5,  5,  7,  8, 10, 13, 16, 18,
                   21, 24, 26, 29, 32, 35, 37, 40};
 
-#if defined(__FreeBSD__)
-static driver_t firewire_driver = {
-       "firewire",
-       firewire_methods,
-       sizeof(struct firewire_softc),
-};
-#endif
-
-/*
- * Lookup fwdev by node id.
- */
-struct fw_device *
-fw_noderesolve_nodeid(struct firewire_comm *fc, int dst)
-{
-       struct fw_device *fwdev;
-       int s;
-
-       s = splfw();
-       FW_GLOCK(fc);
-       STAILQ_FOREACH(fwdev, &fc->devices, link)
-               if (fwdev->dst == dst && fwdev->status != FWDEVINVAL)
-                       break;
-       FW_GUNLOCK(fc);
-       splx(s);
-
-       return fwdev;
-}
-
-/*



Home | Main Index | Thread Index | Old Index